-
Notifications
You must be signed in to change notification settings - Fork 3
calculator reader + parser #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Ideas from the meeting about this:
(for point 1) where |
calc/CalcParser.scala
Outdated
| private val mulDivPass = passDef: | ||
| wellformed := inputWellformed.makeDerived: | ||
| Node.Top ::=! repeated(choice(Number, Expression, AddOp, SubOp)) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idea: wrap Number in separate Expression in separate pre-process pass here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opted to wrap Number in an Expression node in the CalcReader
From this list of ideas, the only one remaining is to leverage Node.Embed to work directly with Int objects. I'm currently working on adding this. |
|
The Node.Embed could be another PR probably, this is already fine code-wise. Given a README that directs a new person how they should read this, etc, this is all done I think. |
|
Added the README, primarily focusing on what each file does and how the passes and wellformed definitions work. I also included images that outline how the AST transforms for a simple visualization. cc: @fhackett - currently feels like some of the explanations for the different components are a bit unclear, LMK what you think. |
|
@navidaminnn I agree that the descriptions could grow a fair amount. They would ideally include even more specific step by step notes on how to write different elements, including Wellformed, specific pattern composition, etc. That said, I think good as a starting point, and all the key points are there. This is so much better than literally nothing that I'd prefer to merge this now and then work on it more later. |
|
Ok, so looking into the random CI failure, it seems to have nothing to do with your changes. The longest running test just barely times out its 30s deadline, and I can fix that best in main anyway. Merging. |
current state is that it's working with most test cases, but struggles with more complex ones.