@algosail/tree-sitter 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +3 -26
- package/package.json +5 -2
- package/src/grammar.json +0 -28
- package/src/parser.c +328 -509
- package/tree-sitter-sail.wasm +0 -0
package/grammar.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="tree-sitter-cli/dsl" />
|
|
2
2
|
// @ts-check
|
|
3
3
|
|
|
4
|
+
const { builtinWords } = require('@algosail/builtins')
|
|
5
|
+
|
|
4
6
|
module.exports = grammar({
|
|
5
7
|
name: 'sail',
|
|
6
8
|
|
|
@@ -197,31 +199,6 @@ module.exports = grammar({
|
|
|
197
199
|
|
|
198
200
|
// All-caps stack-manipulation and control-flow builtins.
|
|
199
201
|
// Listed as a single token() so they take priority over $.identifier.
|
|
200
|
-
builtin_word: ($) =>
|
|
201
|
-
token(
|
|
202
|
-
choice(
|
|
203
|
-
'DUP',
|
|
204
|
-
'SWAP',
|
|
205
|
-
'DROP',
|
|
206
|
-
'OVER',
|
|
207
|
-
'ROT',
|
|
208
|
-
'ROTR',
|
|
209
|
-
'NIP',
|
|
210
|
-
'TUCK',
|
|
211
|
-
'DUP2',
|
|
212
|
-
'DROP2',
|
|
213
|
-
'SWAP2',
|
|
214
|
-
'CALL',
|
|
215
|
-
'MATCH',
|
|
216
|
-
'COMPOSE',
|
|
217
|
-
'IF',
|
|
218
|
-
'MAP',
|
|
219
|
-
'GETL',
|
|
220
|
-
'SETL',
|
|
221
|
-
'UPDL',
|
|
222
|
-
'APP',
|
|
223
|
-
'ERROR',
|
|
224
|
-
),
|
|
225
|
-
),
|
|
202
|
+
builtin_word: ($) => token(choice(...Object.keys(builtinWords))),
|
|
226
203
|
},
|
|
227
204
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algosail/tree-sitter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Tree-sitter grammar for the Sail language",
|
|
5
5
|
"main": "bindings/node",
|
|
6
6
|
"types": "bindings/node",
|
|
@@ -39,5 +39,8 @@
|
|
|
39
39
|
"queries/*",
|
|
40
40
|
"src/**",
|
|
41
41
|
"*.wasm"
|
|
42
|
-
]
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@algosail/builtins": "^0.0.1"
|
|
45
|
+
}
|
|
43
46
|
}
|
package/src/grammar.json
CHANGED
|
@@ -822,34 +822,6 @@
|
|
|
822
822
|
{
|
|
823
823
|
"type": "STRING",
|
|
824
824
|
"value": "COMPOSE"
|
|
825
|
-
},
|
|
826
|
-
{
|
|
827
|
-
"type": "STRING",
|
|
828
|
-
"value": "IF"
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
"type": "STRING",
|
|
832
|
-
"value": "MAP"
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
"type": "STRING",
|
|
836
|
-
"value": "GETL"
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
"type": "STRING",
|
|
840
|
-
"value": "SETL"
|
|
841
|
-
},
|
|
842
|
-
{
|
|
843
|
-
"type": "STRING",
|
|
844
|
-
"value": "UPDL"
|
|
845
|
-
},
|
|
846
|
-
{
|
|
847
|
-
"type": "STRING",
|
|
848
|
-
"value": "APP"
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
"type": "STRING",
|
|
852
|
-
"value": "ERROR"
|
|
853
825
|
}
|
|
854
826
|
]
|
|
855
827
|
}
|