Repository navigation
automatonCompiler: tests of the named indexes of the sub-automatons and of a repetition in an alternative - #250
Merged
Merged
Conversation
SubPartIndexTest checks how the indexes of the constraints are resolved, including the names defined in the sub-automatons (head=4, then right.1.head). SubAutomatonNamedIndexTest compiles with compile-rules the same rule written with right.1.2 and with right.1.head (head=2 or index head=2) and checks that the compiled rules are identical. The lost separator after a named index (head.2 gives 42) is an expected failure. SubPartIndex and SubAutomaton are exported for the test on Windows. The named indexes are documented in the ModEx rules reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 12 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…ive (#34) (a|b|c{1-3}) compiles as (a|b|(c){1-3}), not as (a|b|c){1-3}. The compile-rules helper of the tests is shared in CompileRules.h. Co-Authored-By: Claude Opus 5.5 <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.
Tests and documentation of the named indexes of the sub-automatons (#20, implemented since the initial import but neither tested nor documented).
SubPartIndexTest: resolution of the indexes of the constraints: numeric indexes andfirst/last/current/next, a name at the sub-automaton's level (1.head→1.4) or at the first level (head→4), a name defined by two sub-automatons (the first definition wins), an unknown name (index 0). The lost separator after a named index (1.head.2gives1.42) is an expected failure (QEXPECT_FAIL).SubAutomatonNamedIndexTest: compiles withcompile-rulesthe same rule written withright.1.2and withright.1.head(head=2andindex head=2), and checks that the compiled files are identical; a rule onright.1.1gives a different file.--configDir/--resourcesDirare given explicitly: by defaultcompile-rulesalso searches~/.local/share/lima, whose plugins may not match the build.RepetitionInAlternativeTest(Rule parser accept wrong syntax and generate buggy automaton #34):($NOUN|$PROPN|t_capital_1st{1-3})compiles to the same file as($NOUN|$PROPN|(t_capital_1st){1-3})(the repetition applies to its element only), and to a different file than($NOUN|$PROPN|t_capital_1st){1-3}. Thecompile-ruleshelper of the tests is shared intests/CompileRules.h.SubPartIndexandSubAutomatonare exported (LIMA_AUTOMATONCOMPILER_EXPORT) so that the unit test links on Windows.docs/reference/modex-rules.md: a paragraph on the named indexes.The tests pass locally (Linux, Debug); the Windows and macOS builds are checked by this PR's CI.
🤖 Generated with Claude Code