diff options
Diffstat (limited to 'vrsite/highlight_test.go')
| -rw-r--r-- | vrsite/highlight_test.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vrsite/highlight_test.go b/vrsite/highlight_test.go index b565785..e6897d1 100644 --- a/vrsite/highlight_test.go +++ b/vrsite/highlight_test.go @@ -45,6 +45,13 @@ var samples = []struct { // .h goes to the C++ grammar, but c.scm's patterns still have to reach it {"a.h", "// note\ntemplate <class T> struct Box { T v; };\n", map[string]string{"template": "keyword", "struct": "keyword", "// note": "comment", "T": "type"}}, + // zig names types by casing rather than by node, so Point and MAX are the + // query's two #match? heuristics rather than anything the grammar reports + {"a.zig", "// note\nconst std = @import(\"std\");\nconst Point = struct { x: u8 };\n" + + "pub fn main() !void {\n const MAX: u8 = 1;\n std.debug.print(\"hi\", .{ .x = MAX });\n}\n", + map[string]string{"const": "keyword", `"hi"`: "string", "// note": "comment", + "main": "function", "@import": "function", "u8": "type", "Point": "type", + "MAX": "constant", "x": "property"}}, {"a.json", "{\n \"a\": \"hi\",\n \"b\": 12\n}\n", map[string]string{`"hi"`: "string", `"a"`: "string-special", "12": "number"}}, {"a.sh", "# note\nif true; then\n ls -l \"$dir\"\nfi\n", |
