Giter VIP home page Giter VIP logo

Comments (7)

pdmccormick avatar pdmccormick commented on September 27, 2024

Confirmed with the TA as being a valid expression that our parser must recognize.

from csc488.

d-b avatar d-b commented on September 27, 2024

I'm not sure how that can work without breaking precedence rules.

from csc488.

d-b avatar d-b commented on September 27, 2024

For instance:

  1. not true * 1
  2. not expression
  3. expression

If we changed the behaviour then the precedence would change

  1. not true * 1
  2. expression * 1
  3. expression

This does not seem valid.

from csc488.

orenwatson avatar orenwatson commented on September 27, 2024

We just need to add more rules, roughly:
mulexpr ::= mulexpr * notexpr
addexpr ::= addexpr + notexpr
Can we see if that solves the issue?

from csc488.

orenwatson avatar orenwatson commented on September 27, 2024

I have modified grammar which compiles and parses all test samples. It is a little ugly, however...

from csc488.

d-b avatar d-b commented on September 27, 2024

I think I'm going to close this and go with "won't fix".

We can justify this in the documentation in the discussion of the failing test case. The added complexity in the grammar is not worth the trouble. While it is perhaps syntactically more valid it is certainly not semantically valid. So it would never be a problem in practice.

I'm going to just revert the commit. People can find the fix in the commit history if they have to.

If anyone has a more elegant solution they are welcome to commit it.

from csc488.

orenwatson avatar orenwatson commented on September 27, 2024

Kay. I was actually pushing for a "won't fix" by showing just how screwed up the fix would have to be.

from csc488.

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.