Skip to content

Colour with the compiler's lexer, and host the pages it generates - #28

Merged
onatozmenn merged 1 commit into
mainfrom
what-the-compiler-already-knows
Jul 31, 2026
Merged

Colour with the compiler's lexer, and host the pages it generates#28
onatozmenn merged 1 commit into
mainfrom
what-the-compiler-already-knows

Conversation

@onatozmenn

Copy link
Copy Markdown
Contributor

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_tokens classifies the text on a 150ms fuse and a layer under the textarea paints it.

No type colour: 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 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/ is deed_explain, which hands over all 85 pages, with a filter and a #DEED5001 anchor 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

  • every syntax colour against the editor background: keyword 6.71/7.08, string 6.29/7.37, number 7.05/7.57, comment 6.19/6.13, punctuation 8.20/8.46, error 6.80/5.93 (light/dark)
  • the paint layer and the caret layer agree on position and on every font property
  • the fitted layout still holds at 1920x1080, 1280x800 and 1280x700, and the phone still scrolls as before
  • gutter and colouring follow the textarea's scroll in both axes

Also

tools/check.mjs compares every script's pin against every other, since there are two of them now. Verified by pointing errors.js at the old tag: four complaints, including the two scripts disagreeing.

Written with AI assistance.

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>
@onatozmenn
onatozmenn merged commit 8d3935c into main Jul 31, 2026
1 check passed
@onatozmenn
onatozmenn deleted the what-the-compiler-already-knows branch July 31, 2026 15:02
@onatozmenn onatozmenn mentioned this pull request Jul 31, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host the documentation that is generated over in the compiler An editor surface, starting with the version that has none

1 participant