Giter VIP home page Giter VIP logo

Comments (5)

cpyrgas avatar cpyrgas commented on August 22, 2024

Doesn't seem right to me, now the original code reports "warning XS9076: Empty CASE statement", but isn't that incorrect? There's no empty CASE statement, there's no CASE statement at all, so this should be an error, shouldn't it?

Also there are no warnings at all reported for empty CASE, IF etc statements, I think there used to be one in previous builds:

FUNCTION Start( ) AS VOID

// warning XS9076: Empty CASE statement
DO CASE
END CASE

// no warnings at all below:
DO CASE
CASE FALSE
CASE TRUE
ENDCASE

IF TRUE
ELSE
ENDIF

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

Chris,
It depends on what you call a CASE Statement
For me, that is the total DO CASE .. CASE .. OTHERWISE .. ENDCASE construct.
CASE something is a clause in the CASE statement.
I will change the message to 'DO CASE' statement and will also try to produce a message for the empty statement lists inside a CASE clause and inside IF, ELSEIF and ELSE.

from xsharppublic.

cpyrgas avatar cpyrgas commented on August 22, 2024

Robert,
I think there used to be a warning for empty clauses and that's why we introduced the NOP instruction, didn't we?

Just checked and our runtime code is full of NOPs, I assume for that reason. Apparently this warning stopped being reported in one of the previous builds.

Btw, same goes for TRY...END and empty CATCH and FINALLY clauses

from xsharppublic.

RobertvanderHulst avatar RobertvanderHulst commented on August 22, 2024

I have added warnings for empty blocks, and now many of our compiler tests produce a warning.
I will add NOP statements in the tests to take care of this.

from xsharppublic.

cpyrgas avatar cpyrgas commented on August 22, 2024

Confirmed fixed

from xsharppublic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.