Skip to content

feat(core): KeY label-after-keyword JML statements (assert LAB: e;) + gap status doc - #86

Merged
wadoon merged 3 commits into
mainfrom
weigl/closinggaps
Oct 31, 2026
Merged

wadoon merged 3 commits into
mainfrom
weigl/closinggaps

Conversation

@wadoon

@wadoon wadoon commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Closes the last open parser-level syntax gap to KeY from the closing-gaps pass (see JMLTK_GAPS.md).

What

Verification

:jmlparser-jml-tests:test (full suite incl. new tests), :jmlparser-core:test,
:jmlparser-core-testing:test, spotlessCheck, checkstyleMain — all green.

@github-code-quality

github-code-quality Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Code coverage overview

Languages: Java

Java / code-coverage/jacoco-ubuntu-latest-21

main 5056020 weigl/closinggaps 1f57674 +/-
58% 59% +1%
View coverage of the 10 most impacted files.
File main 5056020 weigl/closinggaps 1f57674 +/-
com/github/java...xprContext.java 92% 91% -1%
com/github/java...essionStmt.java 56% 55% -1%
com/github/java...JavaParser.java 76% 76% 0%
com/github/java...torAdapter.java 72% 72% 0%
com/github/java...torAdapter.java 92% 92% 0%
com/github/java...torAdapter.java 59% 59% 0%
com/github/java...ierVisitor.java 54% 54% 0%
com/github/java...terVisitor.java 78% 78% 0%
com/github/java...kenManager.java 29% 30% +1%
com/github/java...lLabelStmt.java 0% 46% +46%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 31, 2026 16:39 UTC

…B: e;)

Close syntax gap #5: extend JmlExpressionStmt with an optional label
(SimpleName, @OptionalProperty) so formatted statements in KeY's form
'assert LAB: e;' / 'set SN: x = ...;' parse and round-trip, alongside the
JML-standard prefix form (JmlLabelStmt).

- grammar (java.jj JmlStatement): optional '[ LOOKAHEAD(<IDENTIFIER> ":") label=SimpleName() ":" ]'
- printers: DefaultPrettyPrinterVisitor + ConcreteSyntaxModel emit the label
- generated metamodel, visitors, and accessors regenerated (metamodel and code
  generators run in separate Gradle invocations)
- regression tests: jmlparser-jml-tests JmlLabeledAssertTest
Document the empirically verified gap status (constructs 3, 4, 7 already parse;
5 fixed in the preceding commit; 1/6/8 skipped; 2 tracked on weigl/proofscripts).
@wadoon
wadoon force-pushed the weigl/closinggaps branch from e7f4ef5 to 8f948a9 Compare October 29, 2026 23:45
@wadoon
wadoon merged commit 42eded6 into main Oct 31, 2026
13 of 14 checks passed
@wadoon wadoon self-assigned this Oct 31, 2026
@wadoon wadoon added the bug Something isn't working label Oct 31, 2026
wadoon added a commit that referenced this pull request Nov 1, 2026
…eam #86)

Rebase onto origin/main brought in the KeY label-after-keyword feature
(JmlExpressionStmt#label). Regenerate ModifierVisitor and VoidVisitorAdapter
so the label is visited; output is byte-identical to what upstream main's
codegen produces (verified against 42eded6). All other generated files
were already consistent: the 682-file churn from the generators was pure
license-header rewrites (generators emit COPYRIGHT_NOTICE_JP_CORE) and is
reverted entirely by spotlessApply's licenseHeaderFile rule (gradle/header).
wadoon added a commit that referenced this pull request Nov 1, 2026
…nters

DefaultPrettyPrinterVisitor and ConcreteSyntaxModel are hand-maintained
(not emitted by :jmlparser-core-generators:run), so the rebase conflict
resolution kept bf6adc6's pre-#86 versions and lost the KeY
label-after-keyword support from origin/main (#86). Merge upstream's
label emission back in: DPPV prints 'LABEL:' after the keyword, CSM
adds conditional(LABEL, IS_PRESENT, ...). Restores
JmlLabeledAssertTest#roundTripPrinting (assert LAB: x > 0; round-trips).
@wadoon wadoon mentioned this pull request Nov 2, 2026
wadoon added a commit that referenced this pull request Nov 2, 2026
…eam #86)

Rebase onto origin/main brought in the KeY label-after-keyword feature
(JmlExpressionStmt#label). Regenerate ModifierVisitor and VoidVisitorAdapter
so the label is visited; output is byte-identical to what upstream main's
codegen produces (verified against 42eded6). All other generated files
were already consistent: the 682-file churn from the generators was pure
license-header rewrites (generators emit COPYRIGHT_NOTICE_JP_CORE) and is
reverted entirely by spotlessApply's licenseHeaderFile rule (gradle/header).
wadoon added a commit that referenced this pull request Nov 2, 2026
…nters

DefaultPrettyPrinterVisitor and ConcreteSyntaxModel are hand-maintained
(not emitted by :jmlparser-core-generators:run), so the rebase conflict
resolution kept bf6adc6's pre-#86 versions and lost the KeY
label-after-keyword support from origin/main (#86). Merge upstream's
label emission back in: DPPV prints 'LABEL:' after the keyword, CSM
adds conditional(LABEL, IS_PRESENT, ...). Restores
JmlLabeledAssertTest#roundTripPrinting (assert LAB: x > 0; round-trips).
wadoon added a commit that referenced this pull request Nov 2, 2026
After rebasing weigl/lsp onto main, the generated visitors/metamodel/printers
carried the branch's pre-merge keyword-node versions and lost the
element-quantifier (JmlQuantifiedVariable, #83) and KeY label-after-keyword
(#86) visitor/CSM/printer additions that origin/main introduced. Restore the
generator-consistent output (equal to the verified pre-rebase tip):
GenericVisitor, VoidVisitor, the concrete visitor adapters,
DefaultVisitorAdapter, and ConcreteSyntaxModel / DefaultPrettyPrinterVisitor
keyword+label printing.

Verified: :jmlparser-core:compileJava, scripts/run-generators.sh
(git diff --exit-code clean), spotlessApply.
wadoon added a commit that referenced this pull request Nov 2, 2026
…eam #86)

Rebase onto origin/main brought in the KeY label-after-keyword feature
(JmlExpressionStmt#label). Regenerate ModifierVisitor and VoidVisitorAdapter
so the label is visited; output is byte-identical to what upstream main's
codegen produces (verified against 42eded6). All other generated files
were already consistent: the 682-file churn from the generators was pure
license-header rewrites (generators emit COPYRIGHT_NOTICE_JP_CORE) and is
reverted entirely by spotlessApply's licenseHeaderFile rule (gradle/header).
wadoon added a commit that referenced this pull request Nov 2, 2026
…nters

DefaultPrettyPrinterVisitor and ConcreteSyntaxModel are hand-maintained
(not emitted by :jmlparser-core-generators:run), so the rebase conflict
resolution kept bf6adc6's pre-#86 versions and lost the KeY
label-after-keyword support from origin/main (#86). Merge upstream's
label emission back in: DPPV prints 'LABEL:' after the keyword, CSM
adds conditional(LABEL, IS_PRESENT, ...). Restores
JmlLabeledAssertTest#roundTripPrinting (assert LAB: x > 0; round-trips).
wadoon added a commit that referenced this pull request Nov 2, 2026
After rebasing weigl/lsp onto main, the generated visitors/metamodel/printers
carried the branch's pre-merge keyword-node versions and lost the
element-quantifier (JmlQuantifiedVariable, #83) and KeY label-after-keyword
(#86) visitor/CSM/printer additions that origin/main introduced. Restore the
generator-consistent output (equal to the verified pre-rebase tip):
GenericVisitor, VoidVisitor, the concrete visitor adapters,
DefaultVisitorAdapter, and ConcreteSyntaxModel / DefaultPrettyPrinterVisitor
keyword+label printing.

Verified: :jmlparser-core:compileJava, scripts/run-generators.sh
(git diff --exit-code clean), spotlessApply.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant