Colour with the compiler's lexer, and host the pages it generates - #28
Merged
Conversation
The two things left on the playground, both answered by asking the compiler rather than by building a second one. deed-lang/deed#786 added the exports; this uses them, pinned to 0.2.2. An editor component, argued for and rejected. Monaco or CodeMirror fed the TextMate grammar buys colouring and costs a bundle, an oniguruma build, and a second grammar to keep in step with the real one. The lexer is not an approximation of the rule, it is the rule, and it already runs here. So `deed_tokens` classifies the text on a 150ms fuse and a layer under the textarea paints it. No `type` colour, because at that point `Console` and `console` are both an identifier and colouring one differently would claim something no pass has concluded. Text the lexer could not read gets the wavy underline it deserves. Diagnostics in the gutter: the line numbers are there now, and the ones the last check had something to say about are coloured, error over warning. The error index at `/errors/` is `deed_explain`, which hands over all 85 pages. Nothing on it was written here, so it cannot document a code this compiler does not have or miss one it does. 76 of the 85 carry an example, which is the compiler's number and not a choice made here. One thing that was broken and is not: a check could be dropped whenever a paint was still in flight, so the output pane answered about the program before last. The two now re-arm instead of returning, and "busy" and "not loaded" are separate questions, since reading the disabled buttons made a temporary state look permanent. Measured: every syntax colour is at least 5.9 to 1 against the editor background in both themes, the paint layer and the caret layer agree on position and every font property, and the page still fits without scrolling at 1920x1080, 1280x800 and 1280x700. `tools/check.mjs` now compares every script's pin against every other, since there are two of them and two pins that disagree is exactly what the version check exists to catch. Closes #6 Closes #10 Co-authored-by: GitHub Copilot <copilot@github.com>
11 tasks
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.
Closes #6, closes #10. Both by asking the compiler rather than building a second one. deed-lang/deed#786 added the exports; this uses them, and moves the pin to 0.2.2.
The editor component, argued for and rejected
Monaco or CodeMirror fed the TextMate grammar in
editors/vscode/syntaxes/buys colouring and costs a bundle, an oniguruma build, and a second grammar to keep in step with the real one.The lexer is not an approximation of the rule, it is the rule, and it is already in the tab.
deed_tokensclassifies the text on a 150ms fuse and a layer under the textarea paints it.No
typecolour: at that pointConsoleandconsoleare both an identifier, and colouring one differently would claim something no pass has concluded. Text the lexer could not read gets a wavy underline.Diagnostics in the gutter: line numbers, with the ones the last check had something to say about coloured, error over warning on the same line.
The error index
/errors/isdeed_explain, which hands over all 85 pages, with a filter and a#DEED5001anchor per code. Nothing on it was written here, so it cannot document a code this compiler does not have, or miss one it does. 76 of the 85 carry an example, which is the compiler's number rather than a choice made here.One thing that was broken and is not
A check could be dropped whenever a paint was still in flight, so the output pane kept answering about the program before last. Both now re-arm instead of returning, and "busy" and "not loaded" became separate questions: reading the disabled buttons made a temporary state look permanent.
Measured
Also
tools/check.mjscompares every script's pin against every other, since there are two of them now. Verified by pointingerrors.jsat the old tag: four complaints, including the two scripts disagreeing.Written with AI assistance.