aboutsummaryrefslogtreecommitdiff
path: root/grammars/html.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2020-12-14 18:39:56 -0800
committerBruce Hill <bruce@bruce-hill.com>2020-12-14 18:39:56 -0800
commit9617baf699aeff816fae50841e11123ebd9c9366 (patch)
tree504da046e6c109529b66801b5d08d6d1bddc7689 /grammars/html.bp
parentc9daa5f29f1b23e7ce3180b77029b7f61313df20 (diff)
Updated grammars
Diffstat (limited to 'grammars/html.bp')
-rw-r--r--grammars/html.bp18
1 files changed, 7 insertions, 11 deletions
diff --git a/grammars/html.bp b/grammars/html.bp
index cea19c1..1f6553c 100644
--- a/grammars/html.bp
+++ b/grammars/html.bp
@@ -3,24 +3,20 @@ HTML: __ [doctype __] *html-element%__ __
doctype: "<!DOCTYPE" ..`>
-html-element: (
- >(`<("area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr")) void-element
- / >(`<("script"/"style"/"textarea"/"title")) raw-element
- / >(`<("template")) template-element
- / normal-element)
+html-element: void-element / raw-element / template-element / normal-element
-void-element: `< @tag=(id==match-tag) __attributes__ [`/] __ `>
+void-element: `< ("area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr") __attributes__ [`/] __ `>
-template-element: `< @tag=(id==match-tag) __`> __ >match-body @body=*(!`<$. / comment / html-element / !("</"tag__`>)$.) ("</"tag__`>)
+template-element: "<template>"...("</template>") % (comment / html-element)
-raw-element: `< @tag=(id==match-tag) __attributes__ `> >match-body @body=.. ("</"tag__`>)
+raw-element: `< @tag=("script"/"style"/"textarea"/"title") __attributes__ `>...("</"tag__`>)
-normal-element: `< @tag=(id==match-tag) __attributes__ `> >match-body @body=*(!`<$. / comment / html-element / !("</"tag__`>)$.) "</"tag__`>
+normal-element: `< @tag=(
+ "area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr")
+ __attributes__ `>...("</"tag`>) % (comment / html-element)
comment: "<!--" ..."-->"
attributes: *attribute%__
attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`')
attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`')
-match-tag: id
-match-body: ''