Track the LScript changes since the grammar was first written: - some, ok and err are reserved prefix operators and wrapper patterns; the old |.some/|.ok/|.err forms and postfix/prefix ! are rejected - function literal inputs may omit their type annotation, and tuple components may omit theirs; an empty typed tuple pattern is now just the unit pattern - migrate fixtures, corpus, queries, CST contract and Rust tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
50 lines
1006 B
Scheme
50 lines
1006 B
Scheme
[
|
|
"and"
|
|
"as"
|
|
"bits"
|
|
"break"
|
|
"continue"
|
|
"distinct"
|
|
"else"
|
|
"err"
|
|
"for"
|
|
"if"
|
|
"in"
|
|
"loop"
|
|
"match"
|
|
"not"
|
|
"ok"
|
|
"or"
|
|
"pub"
|
|
"return"
|
|
"some"
|
|
"use"
|
|
] @keyword
|
|
|
|
(primitive_type) @type.builtin
|
|
(identifier) @variable
|
|
(comment) @comment
|
|
(default_expression) @keyword
|
|
(boolean_literal) @constant.builtin
|
|
(nil_literal) @constant.builtin
|
|
(string_literal) @string
|
|
(character_literal) @character
|
|
(integer_literal) @number
|
|
(float_literal) @number.float
|
|
(label (identifier) @label)
|
|
|
|
(declaration name: (identifier) @variable.definition)
|
|
(typed_parameter pattern: (identifier) @variable.parameter)
|
|
(typed_tuple_component pattern: (identifier) @variable.parameter)
|
|
(product_field name: (identifier) @property)
|
|
(product_entry (identifier) @property)
|
|
(sum_variant name: (identifier) @constructor)
|
|
(bits_member (identifier) @constant)
|
|
|
|
[
|
|
"=" "+=" "-=" "*=" "/=" "%=" "&=" "^=" "|="
|
|
"==" "<" "<=" ">" ">="
|
|
"+" "-" "*" "/" "%" "&" "|" "^" "~"
|
|
"->" "=>" "|>" "..<" "..=" "@"
|
|
] @operator
|