Update tree-sitter-scheme

pull/5092/head
Blaž Hrastnik 2 years ago
parent 0b96021643
commit bae890d8fa
No known key found for this signature in database
GPG Key ID: 1238B9C4AD889640

@ -1583,7 +1583,7 @@ indent = { tab-width = 2, unit = " " }
[[grammar]] [[grammar]]
name = "scheme" name = "scheme"
source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "27fb77db05f890c2823b4bd751c6420378df146b" } source = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "c0741320bfca6b7b5b7a13b5171275951e96a842" }
[[language]] [[language]]
name = "v" name = "v"

@ -5,8 +5,6 @@
; overrides are unnecessary. ; overrides are unnecessary.
; ------- ; -------
; ------- ; -------
; Types ; Types
; ------- ; -------
@ -241,6 +239,14 @@
(attribute
(identifier) @_macro
arguments: (token_tree (identifier) @constant.numeric.integer)
(#eq? @_macro "derive")
)
@special
; ------- ; -------
; Functions ; Functions
; ------- ; -------
@ -271,6 +277,7 @@
; --- ; ---
; Macros ; Macros
; --- ; ---
(attribute (attribute
(identifier) @function.macro) (identifier) @function.macro)
(attribute (attribute

@ -2,29 +2,40 @@
(character) @constant.character (character) @constant.character
(boolean) @constant.builtin.boolean (boolean) @constant.builtin.boolean
[(string) (string) @string
(character)] @string
(escape_sequence) @constant.character.escape (escape_sequence) @constant.character.escape
[(comment) (comment) @comment.line
(block_comment) (block_comment) @comment.block
(directive)] @comment (directive) @keyword.directive
[(boolean) ; operators
(character)] @constant
((symbol) @function.builtin ((symbol) @operator
(#match? @function.builtin "^(eqv\\?|eq\\?|equal\\?)")) ; TODO (#match? @operator "^(\\+|-|\\*|/|=|>|<|>=|<=)$"))
; keywords ; keywords
(list
.
((symbol) @keyword.conditional ((symbol) @keyword.conditional
(#match? @keyword.conditional "^(if|cond|case|when|unless)$")) (#match? @keyword.conditional "^(if|cond|case|when|unless)$"
)))
((symbol) @keyword (list
.
(symbol) @keyword
(#match? @keyword (#match? @keyword
"^(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)$")) "^(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)$"
))
(list
.
(symbol) @function.builtin
(#match? @function.builtin
"^(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\\?)$"
))
; special forms ; special forms
@ -47,26 +58,16 @@
. .
(list (list
(list (list
(symbol) @variable)) (symbol) @variable.parameter))
(#match? @_f (#match? @_f
"^(let|let\\*|let-syntax|let-values|let\\*-values|letrec|letrec\\*|letrec-syntax)$")) "^(let|let\\*|let-syntax|let-values|let\\*-values|letrec|letrec\\*|letrec-syntax)$"))
; operators
(list
.
(symbol) @operator
(#match? @operator "^([+*/<>=-]|(<=)|(>=))$"))
; quote ; quote
(abbreviation
"'" (symbol)) @constant
(list (list
. .
(symbol) @_f (symbol) @_f
(#eq? @_f "quote")) @symbol (#eq? @_f "quote")) @string.symbol
; library ; library
@ -89,12 +90,10 @@
((symbol) @variable.builtin ((symbol) @variable.builtin
(#eq? @variable.builtin "...")) (#eq? @variable.builtin "..."))
(symbol) @variable
((symbol) @variable.builtin ((symbol) @variable.builtin
(#eq? @variable.builtin ".")) (#eq? @variable.builtin "."))
(symbol) @variable (symbol) @variable
["(" ")" "[" "]" "{" "}"] @punctuation.bracket ["(" ")" "[" "]" "{" "}"] @punctuation.bracket

Loading…
Cancel
Save