Giter Club home page Giter Club logo

Comments (4)

 avatar commented on June 11, 2024

The following are also not supported:
{$IF SOME_CONSTANT >= SOME_INTEGER}
{$IF SOME_CONSTANT > SOME_INTEGER}
{$IF SOME_CONSTANT = SOME_INTEGER}
{$IF SOME_CONSTANT < SOME_INTEGER}
{$IF SOME_CONSTANT <= SOME_INTEGER}

(Basically, any expression other than "DEFINED" or "NOT DEFINED")

from delphiast.

 avatar commented on June 11, 2024

Re my last comment, I suggest we make "complex Conditional Expression evaluation" a separate issue as this would be best implemented AFTER resolving issue #30.

A working solution to the original context specified in this issue has been committed to my fork, and a pull request issued. It has been tested with every combination of expression, and appears to work very well indeed.

from delphiast.

RomanYankovsky avatar RomanYankovsky commented on June 11, 2024

Now it's much better! But we also have to remember that brackets is also not supported yet. Like:

{$IF DEFINED(A) AND (DEFINED(B) OR DEFINED(C))}

I'll create a new issue later to better describe the current state.

from delphiast.

 avatar commented on June 11, 2024

I did think about that before I implemented my intermediary solution.

The only thing there is I'd have to define and build an "expression tree" before evaluating it. It's not exactly the most difficult thing in the world, and I'm going to get that done hopefully this coming weekend when I have some time free.

The reason I did the intermediary solution is that certain units in a particular codebase were using multiple conditional expressions and wouldn't parse. Thus far, I haven't encountered any "conditional expression trees" in our codebase, so I didn't put the extra time in (at this point).

Beauty of outsourcing the solution into its own method (rather than all rolled into that massive CASE OF statement) is that we need only implement it once, and it applies to both {$IF} and {$ELSEIF} statements identically.

from delphiast.

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.