diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-14 18:10:53 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-14 18:10:53 +0200 |
commit | cde4f74ed9dffa1415d9021c343eb599e8866b4d (patch) | |
tree | 68cd8ec7ed3458515736ef825abcf39979602338 /src/grammar.json | |
parent | c549d8b3bbbade9ccb8c208295b35f5afbc7913b (diff) |
Update the grammar a bit
Diffstat (limited to 'src/grammar.json')
-rw-r--r-- | src/grammar.json | 94 |
1 files changed, 87 insertions, 7 deletions
diff --git a/src/grammar.json b/src/grammar.json index 7809ff6..ad8dfcb 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -4,10 +4,72 @@ "source_file": { "type": "REPEAT", "content": { - "type": "SYMBOL", - "name": "node" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "node" + } + ] } }, + "comment": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "/" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "node_name" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "attribute_list" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "{" + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "node_body" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "}" + } + ] + }, "node": { "type": "SEQ", "members": [ @@ -67,8 +129,17 @@ { "type": "REPEAT1", "content": { - "type": "SYMBOL", - "name": "node" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "node" + } + ] } }, { @@ -105,7 +176,7 @@ }, "node_name": { "type": "PATTERN", - "value": "[\\/a-zA-Z:_\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}][a-zA-Z0-9:_\\-.·\\u{00300}-\\u{0036F}\\u{0203F}-\\u{02040}\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}]*", + "value": "[a-zA-Z:_\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}][a-zA-Z0-9:_\\-.·\\u{00300}-\\u{0036F}\\u{0203F}-\\u{02040}\\u{000C0}-\\u{000D6}\\u{000D8}-\\u{000F6}\\u{000F8}-\\u{002FF}\\u{00370}-\\u{0037D}\\u{0037F}-\\u{01FFF}\\u{0200C}-\\u{0200D}\\u{02070}-\\u{0218F}\\u{02C00}-\\u{02FEF}\\u{03001}-\\u{0D7FF}\\u{0F900}-\\u{0FDCF}\\u{0FDF0}-\\u{0FFFD}\\u{10000}-\\u{EFFFF}]*", "flags": "u" }, "text": { @@ -125,8 +196,17 @@ "value": "@" }, { - "type": "SYMBOL", - "name": "node" + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "comment" + }, + { + "type": "SYMBOL", + "name": "node" + } + ] } ] } |