Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a parser issue by requiring end-of-file after standalone expressions, regenerates ANTLR artifacts to reflect the grammar change, adds new tests for invalid syntax cases, updates the ANTLR invocation script, and bumps the package version.
- Enforce EOF on expression-only programs in the grammar
- Regenerate
SimpraParser.interpandSimpraParser.csto pick up the grammar update - Add unit tests for various invalid syntax scenarios and refactor inline model initializers
- Improve
antlr.batwith classpath quoting and suppress echo; bump version to 1.0.15
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/AltaSoft.Simpra.tests/SimpraExpressionTests.cs | Add invalid-syntax tests and consolidate model initializers inline |
| src/AltaSoft.Simpra/antlr.bat | Suppress echo, add -cp quoting and reminder to place the JAR file |
| src/AltaSoft.Simpra/G4/SimpraParser.g4 | Require EOF after exp alternative in program rule |
| src/AltaSoft.Simpra/ANTLR/SimpraParser.interp | Regenerated ATN to match updated grammar |
| src/AltaSoft.Simpra/ANTLR/SimpraParser.cs | Regenerated parser with updated state numbers; added some usings |
| Directory.Build.props | Bumped <Version> to 1.0.15 |
Comments suppressed due to low confidence (2)
src/AltaSoft.Simpra/ANTLR/SimpraParser.cs:24
- The using directive for System.Text appears unused and can be removed to reduce clutter.
using System.Text;
src/AltaSoft.Simpra/ANTLR/SimpraParser.cs:25
- The using directive for System.Diagnostics appears unused and can be removed to reduce clutter.
using System.Diagnostics;
Comment on lines
+4
to
5
|
|
||
|
|
There was a problem hiding this comment.
[nitpick] Consider adding exit /b %ERRORLEVEL% at the end of the script to propagate the ANTLR tool's exit code to the caller.
Suggested change
| exit /b %ERRORLEVEL% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.