From fdc91544b7c7a57243e5504c29dab68e45cc79cc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 17 Jan 2021 19:44:44 -0800 Subject: Improved HTML grammar --- grammars/html.bp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'grammars/html.bp') diff --git a/grammars/html.bp b/grammars/html.bp index c820b4b..ab82f6f 100644 --- a/grammars/html.bp +++ b/grammars/html.bp @@ -1,7 +1,12 @@ -# HTML grammar -HTML: __ [doctype __] *html-element%__ __ +# Syntax definitions for some HTML-specific patterns +# +# NOTE: this is *NOT* intended to be a complete definition of the language's +# syntax! Providing a full language grammar is overkill, because the intended +# use case is finding/replacing string patterns. This task does not require a +# full parse tree, and having one makes the task considerably more complicated. +# See the accompanying README.md for more info. -doctype: " +doctype: " %\n html-element: void-element / raw-element / template-element / normal-element @@ -16,5 +21,4 @@ normal-element: `< @tag=id __attributes__ `>..(") % (\n / comment / html comment: "" % \n attributes: *attribute%__ -attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`') -attribute: (+id%`:)__`=__ (id / `" ..`" / `' ..`') +attribute: (+id%`:)__`=__ (id / string) -- cgit v1.2.3