Repository navigation
Leave the expected tokens out of the recorded syntax errors - #3
Merged
Merged
Conversation
…lica#2) The expected .drawio files of the tests end with the syntax errors of the test file. An ANTLR message lists the expected tokens in the order of their token numbers, which change whenever the grammar of the CRML compiler gets a new keyword, so the units grammar of OpenModelica/CRML#96 made two tests fail although the diagrams are the same. - test/run.mjs records only the position and the first part of the message - the expected files are regenerated; they are the same with the grammar before and after OpenModelica/CRML#96 - dist/crml-diagram.min.js is rebuilt with the current grammar Fixes OpenModelica#2 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
adrpo
added a commit
to OpenModelica/CRML
that referenced
this pull request
Nov 30, 2026
* Move the diagram generator to 727d5d1 (OpenModelica/CRML-diagram#2) The tests of the diagram generator recorded the lists of expected tokens of the syntax errors, whose order changed with the units grammar of #96, so the "Diagram generator" workflow fails on main. OpenModelica/CRML-diagram#3 leaves the lists out of the expected files and rebuilds dist/crml-diagram.min.js. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Split the source lines without \R, for the web build (#108) getLineInfo split the source text with the regular expression \R, which the regular expressions of TeaVM do not have, so the web build threw a PatternSyntaxException on the Units_test models that translate with the jar. \r?\n is also how ANTLR counts the lines of token.getLine(). Fixes #108 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.
Fixes #2
The
Diagram generatorworkflow of OpenModelica/CRML fails onmainsince OpenModelica/CRML#96 was merged (https://github.com/OpenModelica/CRML/actions/runs/46449999049/job/141957603896). The diagrams did not change; the recorded syntax errors did, because an ANTLR message lists the expected tokens in the order of their token numbers and the units grammar numbers the keywords differently.Changes:
test/run.mjsrecords only the position and the first part of a syntax error (mismatched input 'start'), without theexpecting {...}list..drawiofiles are regenerated. Only the error comments at the end change.dist/crml-diagram.min.jsis rebuilt with the grammar of CRMLmain, which the CI of this repository checks.Testing:
npm run buildandnpm testpass with the grammar of CRMLmain(bb6d606).node test/run.mjs --updatewrites the same expected files, so the tests no longer depend on the token numbering.After this is merged the
diagram-generatorsubmodule of OpenModelica/CRML has to be moved to the new commit to get its workflow green.generated by Claude Code