Add assignment
This commit is contained in:
parent
fc9f1467df
commit
38bf9532ad
5 changed files with 2184 additions and 47 deletions
68
src/grammar.json
generated
68
src/grammar.json
generated
|
|
@ -2,14 +2,76 @@
|
|||
"name": "blueprint",
|
||||
"rules": {
|
||||
"source_file": {
|
||||
"type": "STRING",
|
||||
"value": "hello"
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "_definition"
|
||||
}
|
||||
},
|
||||
"_definition": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "assignment"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assignment": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "left",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "operator",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": "="
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "right",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "_expr"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"_expr": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "integer_literal"
|
||||
}
|
||||
]
|
||||
},
|
||||
"identifier": {
|
||||
"type": "PATTERN",
|
||||
"value": "[_\\p{XID_Start}][_\\p{XID_Continue}]*"
|
||||
},
|
||||
"integer_literal": {
|
||||
"type": "PATTERN",
|
||||
"value": "[0-9]+"
|
||||
}
|
||||
},
|
||||
"extras": [
|
||||
{
|
||||
"type": "PATTERN",
|
||||
"value": "\\s"
|
||||
"value": "\\s+"
|
||||
}
|
||||
],
|
||||
"conflicts": [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue