on master help sign in
Drop old cairo grammar, alias to rust for now
commitc6d14302438d3b605e4ed8cd145586bad2458ee6 authorBlaž Hrastnik <blaz@mxxn.io> dateFri 26 May 2023, 11:16 (3 years ago) parent207829e
6 files changed+9−102
languages.toml+3−4 runtime/queries/cairo/highlights.scm+1−94 runtime/queries/cairo/indents.scm+1 runtime/queries/cairo/injections.scm+2−4 runtime/queries/cairo/locals.scm+1 runtime/queries/cairo/textobjects.scm+1
languages.toml+3−4
@@ -1700,10 +1700,9 @@ file-types = ["cairo"]
17001700roots = []
17011701comment-token = "//"
17021702indent = { tab-width = 4, unit = " " }
1703−
1704−[[grammar]]
1705−name = "cairo"
1706−source = { git = "https://github.com/archseer/tree-sitter-cairo", rev = "b249662a1eefeb4d71c9529cdd971e74fecc10fe" }
1703+# auto-format = true
1704+language-server = { command = "cairo-language-server", args = [] }
1705+grammar = "rust"
17071706
17081707[[language]]
17091708name = "cpon"
runtime/queries/cairo/highlights.scm+1−94
@@ -1,94 +1 @@
1−(ERROR) @error
2−
3−((identifier) @constant
4− (#match? @constant "^[A-Z][A-Z\\d_]+$"))
5−((identifier_def) @constant
6− (#match? @constant "^[A-Z][A-Z\\d_]+$"))
7−
8−((identifier) @namespace
9− (#match? @namespace "^[A-Z]"))
10−((identifier_def) @namespace
11− (#match? @namespace "^[A-Z]"))
12−
13−(identifier "." @punctuation)
14−(function_call (identifier) @function)
15−(func (identifier_def) @function)
16−
17−(string) @string
18−(atom_short_string) @string
19−
20−(code_element_directive) @keyword.directive
21−"return" @keyword
22−
23−(number) @constant.numeric
24−(atom_hex_number) @constant.numeric
25−
26−(comment) @comment
27−
28−"*" @special
29−(type) @type
30−
31−[
32− "felt"
33− ; "codeoffset"
34−] @type.builtin
35−
36−[
37− "if"
38− "else"
39− "assert"
40− "with"
41− "with_attr"
42−] @keyword.control
43−
44−[
45− "from"
46− "import"
47− "func"
48− "namespace"
49−] @keyword ; keyword.declaration
50−
51−[
52− "let"
53− "const"
54− "local"
55− "struct"
56− "alloc_locals"
57− "tempvar"
58−] @keyword
59−
60−(decorator) @attribute
61−
62−[
63− "="
64− "+"
65− "-"
66− "*"
67− "/"
68− ; "%"
69− ; "!"
70− ; ">"
71− ; "<"
72− ; "\\"
73− ; "&"
74− ; "?"
75− ; "^"
76− ; "~"
77− "=="
78− "!="
79− "new"
80−] @operator
81−
82−[
83− "("
84− ")"
85− "["
86− "]"
87− "{"
88− "}"
89−] @punctuation.bracket
90−
91−[
92− ","
93− ":"
94−] @punctuation.delimiter
1+; inherits: rust
runtime/queries/cairo/indents.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: rust
runtime/queries/cairo/injections.scm+2−4
@@ -1,5 +1,3 @@
1−((hint) @injection.content
2− (#set! injection.language "python"))
3−
4−((comment) @injection.content
1+([(line_comment) (block_comment)] @injection.content
52 (#set! injection.language "comment"))
3+
runtime/queries/cairo/locals.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: rust
runtime/queries/cairo/textobjects.scmnew file+1
@@ -0,0 +1 @@
1+; inherits: rust