Skip to content

Remove highlight_html_page, fix keyword heuristic for K_ rules#778

Merged
gfx merged 1 commit intomainfrom
claude/gale-syntax-highlighter-TTVpA
Apr 5, 2026
Merged

Remove highlight_html_page, fix keyword heuristic for K_ rules#778
gfx merged 1 commit intomainfrom
claude/gale-syntax-highlighter-TTVpA

Conversation

@gfx
Copy link
Copy Markdown
Member

@gfx gfx commented Apr 5, 2026

Summary

  • Remove highlight_html_page and split_lines from Gale runtime — highlight() now returns plain HTML spans (matching tree-sitter output format), not a full page with styles/line-number table
  • Fix keyword heuristic: classify lexer rules prefixed with K_ or KW_ as keyword (e.g. K_SELECT, KW_IF — common in ANTLR grammars like SQLite.g4)
  • Add driver_sqlite_highlight_test.wado with tests for keyword, string, number, comment, punctuation, and operator highlighting

Test plan

  • wado test package-gale/src/runtime_test.wado — 23 passed
  • wado test package-gale/tests/driver_sqlite_highlight_test.wado — 7 passed (keyword tests were red before fix)
  • wado test package-gale/tests/driver_json_highlight_test.wado — 7 passed (no regression)
  • All golden files updated via mise run update-gale-golden

https://claude.ai/code/session_01AeL3xUo2isDA6H79bcgC35

- Remove highlight_html_page and split_lines from runtime (highlight
  should return plain HTML spans, not a full page with styles)
- Generated highlight() now calls highlight_html() directly
- Add keyword classification for lexer rules prefixed with K_ or KW_
  (e.g. K_SELECT, KW_IF) — common in ANTLR grammars like SQLite.g4
- Add driver_sqlite_highlight_test.wado with TDD tests for keyword,
  string, number, comment, punctuation, and operator highlighting
- Update all golden files (runtime change propagates to inlined code)

https://claude.ai/code/session_01AeL3xUo2isDA6H79bcgC35
@gfx gfx enabled auto-merge April 5, 2026 13:29
@gfx gfx merged commit f710d7f into main Apr 5, 2026
10 checks passed
@gfx gfx deleted the claude/gale-syntax-highlighter-TTVpA branch April 5, 2026 13:38
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.

2 participants