Add equality operator
This commit is contained in:
parent
20e6af2257
commit
b4a114108b
@ -1 +1 @@
|
||||
Subproject commit b308c1852f76d21ca52c69620975590fd4871818
|
||||
Subproject commit ad429b35634097c1f81a7ce01f5890fb4594a128
|
@ -1,6 +1,8 @@
|
||||
module.exports = grammar({
|
||||
name: 'dust',
|
||||
|
||||
word: $ => $.identifier,
|
||||
|
||||
rules: {
|
||||
root: $ => repeat1($.item),
|
||||
|
||||
@ -23,8 +25,8 @@ module.exports = grammar({
|
||||
expression: $ => choice(
|
||||
$.value,
|
||||
$.identifier,
|
||||
prec(0, $.control_flow),
|
||||
prec(1, $.operation),
|
||||
$.operation,
|
||||
$.control_flow,
|
||||
),
|
||||
|
||||
close: $ => ";",
|
||||
@ -66,6 +68,7 @@ module.exports = grammar({
|
||||
'+',
|
||||
'-',
|
||||
'=',
|
||||
'==',
|
||||
),
|
||||
|
||||
operation: $ => prec.left(seq(
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "dust",
|
||||
"word": "identifier",
|
||||
"rules": {
|
||||
"root": {
|
||||
"type": "REPEAT1",
|
||||
@ -83,14 +84,6 @@
|
||||
"expression": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "control_flow"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "value"
|
||||
@ -100,12 +93,12 @@
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "PREC",
|
||||
"value": 3,
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "operation"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "control_flow"
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -234,6 +227,10 @@
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "="
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "=="
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -248,6 +248,10 @@
|
||||
"type": "=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "==",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "close",
|
||||
"named": true
|
||||
|
2739
src/parser.c
2739
src/parser.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user