Giter Site home page Giter Site logo

More Compact Conditionals about grammar HOT 8 CLOSED

twalmsley avatar twalmsley commented on July 20, 2024
More Compact Conditionals

from grammar.

Comments (8)

elliottinvent avatar elliottinvent commented on July 20, 2024

I really like this, please take a look at how this could be changed without too much impact on the interpreter.

from grammar.

twalmsley avatar twalmsley commented on July 20, 2024

This is a straightforward change to the grammar, and all the existing tests still pass, but I only made the change to modl_value_conditional because it requires an else clause and this new grammar will always return true or false. The other conditionals have optional else clauses so we probably don't want to allow this format in those situations - do you agree @elliottinvent @alexdalitz ? (I won't commit the changes until you've had a chance to reply)

from grammar.

elliottinvent avatar elliottinvent commented on July 20, 2024

Yes I agree, I think this is the only way it can work. Please commit and close.

from grammar.

twalmsley avatar twalmsley commented on July 20, 2024

Change submitted.

from grammar.

elliottinvent avatar elliottinvent commented on July 20, 2024

This doesn't seem to be working on the new playground which @quentin-num recently put online, @alexdalitz does this work at your end? Not sure if it required an interpreter change?

from grammar.

elliottinvent avatar elliottinvent commented on July 20, 2024

It works on new playground using latest version so this isn't an issue.

from grammar.

elliottinvent avatar elliottinvent commented on July 20, 2024

This works:

_country = gb
support_contact = {country=gb?}

but this doesn't:

_country = gb
support_contact = {
  country=gb?
}

from grammar.

twalmsley avatar twalmsley commented on July 20, 2024

Made a minor change to the grammar to fix this - no interpreter code changes necessary. The interpreters should work fine once their ANTLR4 files are updated. I also added a test case for it.

from grammar.

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.