on master help sign in
Update tree-sitter-scheme
commitbae890d8faa993333d81e662b6f0a6bc5e921a92 authorBlaž Hrastnik <blaz@mxxn.io> dateMon 12 Dec 2022, 17:49 (4 years ago) parent0b96021
3 files changed+37−31
languages.toml+1−1 runtime/queries/rust/highlights.scm+9−2 runtime/queries/scheme/highlights.scm+27−28
languages.toml+1−1
@@ -1583,7 +1583,7 @@ indent = { tab-width = 2, unit = " " }
15831583
15841584[[grammar]]
15851585name = "scheme"
1586−source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "27fb77db05f890c2823b4bd751c6420378df146b" }
1586+source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "c0741320bfca6b7b5b7a13b5171275951e96a842" }
15871587
15881588[[language]]
15891589name = "v"
runtime/queries/rust/highlights.scm+9−2
@@ -5,8 +5,6 @@
55; overrides are unnecessary.
66; -------
77
8−
9−
108; -------
119; Types
1210; -------
@@ -241,6 +239,14 @@
241239
242240
243241
242+(attribute
243+ (identifier) @_macro
244+ arguments: (token_tree (identifier) @constant.numeric.integer)
245+ (#eq? @_macro "derive")
246+)
247+@special
248+
249+
244250; -------
245251; Functions
246252; -------
@@ -271,6 +277,7 @@
271277; ---
272278; Macros
273279; ---
280+
274281(attribute
275282 (identifier) @function.macro)
276283(attribute
runtime/queries/scheme/highlights.scm+27−28
@@ -2,29 +2,40 @@
22(character) @constant.character
33(boolean) @constant.builtin.boolean
44
5−[(string)
6− (character)] @string
5+(string) @string
76
87(escape_sequence) @constant.character.escape
98
10−[(comment)
11− (block_comment)
12− (directive)] @comment
9+(comment) @comment.line
10+(block_comment) @comment.block
11+(directive) @keyword.directive
1312
14−[(boolean)
15− (character)] @constant
13+; operators
1614
17−((symbol) @function.builtin
18− (#match? @function.builtin "^(eqv\\?|eq\\?|equal\\?)")) ; TODO
15+((symbol) @operator
16+ (#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$"))
1917
2018; keywords
2119
22−((symbol) @keyword.conditional
23− (#match? @keyword.conditional "^(if|cond|case|when|unless)$"))
20+(list
21+ .
22+ ((symbol) @keyword.conditional
23+ (#match? @keyword.conditional "^(if|cond|case|when|unless)$"
24+ )))
2425
25−((symbol) @keyword
26− (#match? @keyword
27− "^(define|lambda|begin|do|define-syntax|and|or|if|cond|case|when|unless|else|=>|let|let*|let-syntax|let-values|let*-values|letrec|letrec*|letrec-syntax|set!|syntax-rules|identifier-syntax|quote|unquote|quote-splicing|quasiquote|unquote-splicing|delay|assert|library|export|import|rename|only|except|prefix)$"))
26+(list
27+ .
28+ (symbol) @keyword
29+ (#match? @keyword
30+ "^(define-syntax|let\\*|lambda|λ|case|=>|quote-splicing|unquote-splicing|set!|let|letrec|letrec-syntax|let-values|let\\*-values|do|else|define|cond|syntax-rules|unquote|begin|quote|let-syntax|and|if|quasiquote|letrec|delay|or|when|unless|identifier-syntax|assert|library|export|import|rename|only|except|prefix)$"
31+ ))
32+
33+(list
34+ .
35+ (symbol) @function.builtin
36+ (#match? @function.builtin
37+ "^(caar|cadr|call-with-input-file|call-with-output-file|cdar|cddr|list|open-input-file|open-output-file|with-input-from-file|with-output-to-file|\\*|\\+|-|/|<|<=|=|>|>=|abs|acos|angle|append|apply|asin|assoc|assq|assv|atan|boolean\\?|caaaar|caaadr|caaar|caadar|caaddr|caadr|cadaar|cadadr|cadar|caddar|cadddr|caddr|call-with-current-continuation|call-with-values|car|cdaaar|cdaadr|cdaar|cdadar|cdaddr|cdadr|cddaar|cddadr|cddar|cdddar|cddddr|cdddr|cdr|ceiling|char->integer|char-alphabetic\\?|char-ci<=\\?|char-ci<\\?|char-ci=\\?|char-ci>=\\?|char-ci>\\?|char-downcase|char-lower-case\\?|char-numeric\\?|char-ready\\?|char-upcase|char-upper-case\\?|char-whitespace\\?|char<=\\?|char<\\?|char=\\?|char>=\\?|char>\\?|char\\?|close-input-port|close-output-port|complex\\?|cons|cos|current-error-port|current-input-port|current-output-port|denominator|display|dynamic-wind|eof-object\\?|eq\\?|equal\\?|eqv\\?|eval|even\\?|exact->inexact|exact\\?|exp|expt|floor|flush-output|for-each|force|gcd|imag-part|inexact->exact|inexact\\?|input-port\\?|integer->char|integer\\?|interaction-environment|lcm|length|list->string|list->vector|list-ref|list-tail|list\\?|load|log|magnitude|make-polar|make-rectangular|make-string|make-vector|map|max|member|memq|memv|min|modulo|negative\\?|newline|not|null-environment|null\\?|number->string|number\\?|numerator|odd\\?|output-port\\?|pair\\?|peek-char|positive\\?|procedure\\?|quotient|rational\\?|rationalize|read|read-char|real-part|real\\?|remainder|reverse|round|scheme-report-environment|set-car!|set-cdr!|sin|sqrt|string|string->list|string->number|string->symbol|string-append|string-ci<=\\?|string-ci<\\?|string-ci=\\?|string-ci>=\\?|string-ci>\\?|string-copy|string-fill!|string-length|string-ref|string-set!|string<=\\?|string<\\?|string=\\?|string>=\\?|string>\\?|string\\?|substring|symbol->string|symbol\\?|tan|transcript-off|transcript-on|truncate|values|vector|vector->list|vector-fill!|vector-length|vector-ref|vector-set!|vector\\?|write|write-char|zero\\?)$"
38+ ))
2839
2940; special forms
3041
@@ -47,26 +58,16 @@
4758 .
4859 (list
4960 (list
50− (symbol) @variable))
61+ (symbol) @variable.parameter))
5162 (#match? @_f
5263 "^(let|let\\*|let-syntax|let-values|let\\*-values|letrec|letrec\\*|letrec-syntax)$"))
5364
54−; operators
55−
56−(list
57− .
58− (symbol) @operator
59− (#match? @operator "^([+*/<>=-]|(<=)|(>=))$"))
60−
6165; quote
6266
63−(abbreviation
64− "'" (symbol)) @constant
65−
6667(list
6768 .
6869 (symbol) @_f
69− (#eq? @_f "quote")) @symbol
70+ (#eq? @_f "quote")) @string.symbol
7071
7172; library
7273
@@ -89,12 +90,10 @@
8990((symbol) @variable.builtin
9091 (#eq? @variable.builtin "..."))
9192
92−(symbol) @variable
9393((symbol) @variable.builtin
9494 (#eq? @variable.builtin "."))
9595
9696(symbol) @variable
9797
98−
9998["(" ")" "[" "]" "{" "}"] @punctuation.bracket
10099