diff options
| author | Ralph Amissah <ralph.amissah@gmail.com> | 2026-05-10 00:04:25 -0400 |
|---|---|---|
| committer | Ralph Amissah <ralph.amissah@gmail.com> | 2026-05-10 00:04:25 -0400 |
| commit | 8e359296007fc7bf561355a8454b88db4457483b (patch) | |
| tree | 1bc15946de7082923375d4d2c514eb9544b579a7 /src/grammar.json | |
| parent | grammar: restrict header_key to recognised SiSU YAML keys (diff) | |
grammar: promote editor-note channel marker to named node
Editor notes have two semantic channels in original SiSU markup:
~[* ... ]~ asterisk set, general annotations (e.g. on the author)
~[+ ... ]~ plus set, a separate channel (e.g. TODO / review)
These are not interchangeable - the channel is meaningful, and
themes should be free to colour them differently. Promote the
opener from an inline literal to a named child node
(editor_note_marker) on a `marker:` field, and give it the
@attribute capture in highlights.scm - distinct from the generic
@punctuation.special used for ~{ / }~ / ]~.
A bare `~[ ... ]~` without `*` or `+` is intentionally rejected:
authors must pick a channel. This surfaces the markup bug at
/Not Without Help/ line 695 (which uses the bare form) as a parse
error, consistent with the project rule that strict structural
parsing is preferred over silent regex permissiveness.
Test corpus updated to expect the new (editor_note_marker) child.
(assisted by Claude-Code)
Diffstat (limited to 'src/grammar.json')
| -rw-r--r-- | src/grammar.json | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/grammar.json b/src/grammar.json index 08e4ee1..6a6437c 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1815,17 +1815,26 @@ "type": "SEQ", "members": [ { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": "~[*" + "type": "FIELD", + "name": "marker", + "content": { + "type": "ALIAS", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "~[*" + }, + { + "type": "STRING", + "value": "~[+" + } + ] }, - { - "type": "STRING", - "value": "~[+" - } - ] + "named": true, + "value": "editor_note_marker" + } }, { "type": "STRING", |
