Repository navigation
Add the KeY 3 migration guide and improve code highlighting - #64
Merged
Merged
Conversation
Port the KeY wiki migration guide to the user documentation. It covers contract and field naming changes, parametric sorts and functions, saved proofs, and the stricter JML placement rules of KeY 3. Link the new page from the User Guide index and the 3.0.0 release notes. Fixes #53
The Java examples contain JML annotations, so fence them as jml rather than java.
Vendor the Prism diff language and diff-highlight plugin and wire up `diff-<language>` fences, so added and removed lines are coloured while the unchanged text keeps the inner language's highlighting. Use `diff-json` for the proof-obligation diffs and `diff-key` for the saved proof example in the migration guide. Document the new fences and add light/dark styles for deleted and inserted lines.
The JML grammar recognised `/*@` but not the plain `*/` closing delimiter, so Prism's Java operator token swallowed `*/` and rendered it bold. Match `*/` as a delimiter (keeping `@*/` for the older form), give the whole annotation a subtle background, and style both delimiters with their own colour and background. Apply the same treatment in dark mode.
Document `diff-<language>` fences with a proof-obligation example and its rendered result, so authors can copy the syntax.
Add prism-javascript so the bundle contains the complete default Prism language set (markup, CSS, C-like and JavaScript). Wire up the `javascript` and `js` fences and document them.
Expand the JML keyword lists from JmlLexer.g4 and make the KeY grammar understand taclet, declaration, settings and varcond keywords from KeYLexer.g4 and JavaKeYLexer.g4. JML clauses and modifiers are also highlighted at the top level of key blocks, sharing the vocabulary in prism-jml.js. Add the remaining modality keywords, `<=!=>` sequent arrows and the JavaDL literals TRUE/FALSE.
`requires` is both a JML clause and a Java keyword (module declarations). Match JML clauses before Java keywords, but keep modifiers after them so `public`, `final` and friends retain their Java colour.
Prism tokenises a `/*@ ... */` annotation as one inline span, so its background only covered the text on each line. After highlighting, make multi-line annotations inline-block and offset them so the background fills the whole area between the delimiters while the original indentation is preserved. Strengthen the annotation and delimiter colours so the highlighted area is distinct from the code block background in light and dark mode.
`jml` and `key` are distinct languages. Stop sharing the JML keyword lists with Key and do not treat JML clauses/modifiers as top-level Key keywords. JML annotations in Key files still use the inherited JML grammar; the Key keywords come from KeYLexer.g4 and JavaKeYLexer.g4.
Add prism-lisp and wire up `lisp`, `elisp`, `emacs` and matching `diff-lisp`/`diff-elisp` fences.
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.
Summary
Adds the KeY 2.13 → KeY 3.0 migration guide from the KeY wiki, together with the syntax-highlighting fixes needed to render its examples.
Migration guide
content/user/migration-key-3.md: contract/field naming, parametric sorts and functions, saved proofs, stricter JML rules, and the known class-modifier issue.#heading, correct fences, typo fixes).Prism / code highlighting
jmlfences./*@ … */annotations get a darker background, delimiters are styled, and multi-line annotations fill the whole area between the delimiters.diff-<language>fences highlight added/removed lines while keeping the inner language's syntax colours; documented with a rendered example. The guide usesdiff-jsonanddiff-key.lisp/elispanddiff-lisp/diff-elispfences.KeYLexer.g4/JavaKeYLexer.g4(taclet, declaration, settings and varcond keywords, modalities,<=!=>, schema variables,TRUE/FALSE). JML and KeY remain separate languages: JML keywords are handled by the JML grammar and do not leak into top-level Key keywords.Closes #53.
Latest tweak
Verification
make buildpassesmake checkpasses (0 link errors)go.mod/go.sumunchanged