From aac81630c81f7bef8920ce4681033f481c62a64c Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:53:54 -1000 Subject: Cover the rest of syntax-highlight's output No token ever took hl-type or hl-comment, so a typo in either row, or a rule gone from the stylesheet, passed. Nothing fed the filter a NUL byte or a blob of exactly the size cap either. --- tests/extensions/fake-lexers/lexer.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/extensions/fake-lexers/lexer.lua') diff --git a/tests/extensions/fake-lexers/lexer.lua b/tests/extensions/fake-lexers/lexer.lua index c9d8cff..a43e8e6 100644 --- a/tests/extensions/fake-lexers/lexer.lua +++ b/tests/extensions/fake-lexers/lexer.lua @@ -11,13 +11,16 @@ local M = {} -- Tokens come back the way Scintillua returns them, one flat list of a tag -- name and the position just past the token it names. Letter runs are --- keywords, digit runs are numbers, a single quoted run carries a dotted tag --- so the dotted first component lookup gets exercised, a run after a colon or --- a dollar sign takes one of the tags only the css lexer uses, and any other --- byte is whitespace, which maps to no css class. +-- keywords, or types when capitalised, digit runs are numbers, the rest of a +-- line after two dashes is a comment, a single quoted run carries a dotted +-- tag so the dotted first component lookup gets exercised, a run after a +-- colon or a dollar sign takes one of the tags only the css lexer uses, and +-- any other byte is whitespace, which maps to no css class. local patterns = { { "^:%a+", "pseudoclass" }, { "^%$%a+", "property" }, + { "^%-%-[^\n]*", "comment" }, + { "^%u%a*", "type" }, { "^%a+", "keyword" }, { "^%d+", "number" }, { "^'[^']*'", "string.double" }, -- cgit 2.12.1