diff options
Diffstat (limited to 'grammars/html.bpeg')
| -rw-r--r-- | grammars/html.bpeg | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/grammars/html.bpeg b/grammars/html.bpeg index 7af1f63..451e61c 100644 --- a/grammars/html.bpeg +++ b/grammars/html.bpeg @@ -1,5 +1,5 @@ # HTML grammar -HTML = __ ?(doctype __) *html-element%__ __; +HTML = __ 0-1(doctype __) 0+html-element%__ __; doctype = "<!DOCTYPE" ..`>; @@ -9,19 +9,19 @@ html-element = ( / >(`<("template")) template-element / normal-element); -void-element = `< @[tag](id==match-tag) __attributes__ ?`/ __ `>; +void-element = `< @[tag](id==match-tag) __attributes__ 0-1`/ __ `>; template-element = `< @[tag](id==match-tag) __`> __ >match-body @[body]0+(!`<$. / comment / html-element / !("</"tag__`>)$.) ("</"tag__`>); raw-element = `< @[tag](id==match-tag) __attributes__ `> >match-body @[body].. ("</"tag__`>); -normal-element = `< @[tag](id==match-tag) __attributes__ `> >match-body @[body]*(!`<$. / comment / html-element / !("</"tag__`>)$.) "</"tag__`>; +normal-element = `< @[tag](id==match-tag) __attributes__ `> >match-body @[body]0+(!`<$. / comment / html-element / !("</"tag__`>)$.) "</"tag__`>; comment = "<!--" ..."-->"; -attributes = *(!(attribute==match-attribute))%__ __(attribute==match-attribute)__ *attribute%__; -attribute = (+id%`:)__`=__ (id / `" ..`" / `' ..`'); -attribute = (+id%`:)__`=__ (id / `" ..`" / `' ..`'); +attributes = 0+(!(attribute==match-attribute))%__ __(attribute==match-attribute)__ 0+attribute%__; +attribute = (1+id%`:)__`=__ (id / `" ..`" / `' ..`'); +attribute = (1+id%`:)__`=__ (id / `" ..`" / `' ..`'); match-attribute = attribute; match-tag = id; match-body = (/); |
