aboutsummaryrefslogtreecommitdiff
path: root/src/grammar.json
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-09-14 22:22:41 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-09-14 22:22:41 +0200
commitbe988fbc200620bfff8657b7baf868234e899e13 (patch)
tree9089b4d1fd6aaaae08a69ac898dc6199bf164c87 /src/grammar.json
parent642d5264e0d7b3d3870d13c2cc4a04987ee65ab6 (diff)
Lots of changes once again!
Diffstat (limited to 'src/grammar.json')
-rw-r--r--src/grammar.json127
1 files changed, 98 insertions, 29 deletions
diff --git a/src/grammar.json b/src/grammar.json
index 060f61c..8fbe7dc 100644
--- a/src/grammar.json
+++ b/src/grammar.json
@@ -29,8 +29,44 @@
"value": "/"
},
{
- "type": "SYMBOL",
- "name": "node"
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "FIELD",
+ "name": "name",
+ "content": {
+ "type": "SYMBOL",
+ "name": "ident"
+ }
+ },
+ {
+ "type": "BLANK"
+ }
+ ]
+ },
+ {
+ "type": "CHOICE",
+ "members": [
+ {
+ "type": "FIELD",
+ "name": "attrs",
+ "content": {
+ "type": "SYMBOL",
+ "name": "attr_list"
+ }
+ },
+ {
+ "type": "BLANK"
+ }
+ ]
+ },
+ {
+ "type": "FIELD",
+ "name": "body",
+ "content": {
+ "type": "SYMBOL",
+ "name": "node_body"
+ }
}
]
},
@@ -38,15 +74,23 @@
"type": "SEQ",
"members": [
{
- "type": "SYMBOL",
- "name": "node_name"
+ "type": "FIELD",
+ "name": "name",
+ "content": {
+ "type": "SYMBOL",
+ "name": "ident"
+ }
},
{
"type": "CHOICE",
"members": [
{
- "type": "SYMBOL",
- "name": "attrs"
+ "type": "FIELD",
+ "name": "attrs",
+ "content": {
+ "type": "SYMBOL",
+ "name": "attr_list"
+ }
},
{
"type": "BLANK"
@@ -54,16 +98,15 @@
]
},
{
- "type": "SYMBOL",
- "name": "node_body"
+ "type": "FIELD",
+ "name": "body",
+ "content": {
+ "type": "SYMBOL",
+ "name": "node_body"
+ }
}
]
},
- "node_name": {
- "type": "PATTERN",
- "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
- "flags": "u"
- },
"node_body": {
"type": "SEQ",
"members": [
@@ -119,7 +162,7 @@
}
]
},
- "attrs": {
+ "attr_list": {
"type": "REPEAT1",
"content": {
"type": "CHOICE",
@@ -143,17 +186,24 @@
"type": "SEQ",
"members": [
{
- "type": "PATTERN",
- "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
- "flags": "u"
+ "type": "FIELD",
+ "name": "name",
+ "content": {
+ "type": "SYMBOL",
+ "name": "ident"
+ }
},
{
"type": "STRING",
"value": "="
},
{
- "type": "PATTERN",
- "value": "\"(\\\\[\"\\\\]|[^\"\\\\])+\""
+ "type": "FIELD",
+ "name": "value",
+ "content": {
+ "type": "SYMBOL",
+ "name": "string"
+ }
}
]
},
@@ -165,12 +215,17 @@
"value": "#"
},
{
- "type": "IMMEDIATE_TOKEN",
+ "type": "ALIAS",
"content": {
- "type": "PATTERN",
- "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
- "flags": "u"
- }
+ "type": "IMMEDIATE_TOKEN",
+ "content": {
+ "type": "PATTERN",
+ "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
+ "flags": "u"
+ }
+ },
+ "named": true,
+ "value": "ident"
}
]
},
@@ -182,12 +237,17 @@
"value": "."
},
{
- "type": "IMMEDIATE_TOKEN",
+ "type": "ALIAS",
"content": {
- "type": "PATTERN",
- "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
- "flags": "u"
- }
+ "type": "IMMEDIATE_TOKEN",
+ "content": {
+ "type": "PATTERN",
+ "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
+ "flags": "u"
+ }
+ },
+ "named": true,
+ "value": "ident"
}
]
},
@@ -215,6 +275,15 @@
}
]
}
+ },
+ "ident": {
+ "type": "PATTERN",
+ "value": "\\p{XID_Start}[-\\p{XID_Continue}]*",
+ "flags": "u"
+ },
+ "string": {
+ "type": "PATTERN",
+ "value": "\"(\\\\[\"\\\\]|[^\"\\\\])+\""
}
},
"extras": [