Compare commits
No commits in common. "b4a114108bc8522aed9cd1fc51ff4201d3729967" and "f57570f14bb8542562f58b7572a9d440cca7bb21" have entirely different histories.
b4a114108b
...
f57570f14b
@ -1 +1 @@
|
||||
Subproject commit ad429b35634097c1f81a7ce01f5890fb4594a128
|
||||
Subproject commit 3182e7c860ac74d1d4e2846152eef45c4111bd63
|
11
grammar.js
11
grammar.js
@ -1,8 +1,6 @@
|
||||
module.exports = grammar({
|
||||
name: 'dust',
|
||||
|
||||
word: $ => $.identifier,
|
||||
|
||||
rules: {
|
||||
root: $ => repeat1($.item),
|
||||
|
||||
@ -23,10 +21,10 @@ module.exports = grammar({
|
||||
open_statement: $ => prec.left(seq($.expression)),
|
||||
|
||||
expression: $ => choice(
|
||||
$.value,
|
||||
$.identifier,
|
||||
$.operation,
|
||||
$.control_flow,
|
||||
prec(0, $.control_flow),
|
||||
prec(1, $.value),
|
||||
prec(2, $.identifier),
|
||||
prec(3, $.operation),
|
||||
),
|
||||
|
||||
close: $ => ";",
|
||||
@ -68,7 +66,6 @@ module.exports = grammar({
|
||||
'+',
|
||||
'-',
|
||||
'=',
|
||||
'==',
|
||||
),
|
||||
|
||||
operation: $ => prec.left(seq(
|
||||
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"name": "dust",
|
||||
"word": "identifier",
|
||||
"rules": {
|
||||
"root": {
|
||||
"type": "REPEAT1",
|
||||
@ -85,21 +84,37 @@
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "operation"
|
||||
},
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "control_flow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 1,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "value"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 2,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 3,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "operation"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"close": {
|
||||
@ -227,10 +242,6 @@
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "="
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "=="
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -248,10 +248,6 @@
|
||||
"type": "=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "==",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "close",
|
||||
"named": true
|
||||
|
2795
src/parser.c
2795
src/parser.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user