diff options
Diffstat (limited to 'grammars')
| -rw-r--r-- | grammars/c++.bp | 4 | ||||
| -rw-r--r-- | grammars/c.bp | 4 | ||||
| -rw-r--r-- | grammars/go.bp | 4 | ||||
| -rw-r--r-- | grammars/html.bp | 10 | ||||
| -rw-r--r-- | grammars/javascript.bp | 6 | ||||
| -rw-r--r-- | grammars/lisp.bp | 4 | ||||
| -rw-r--r-- | grammars/lua.bp | 10 | ||||
| -rw-r--r-- | grammars/python.bp | 4 | ||||
| -rw-r--r-- | grammars/rust.bp | 4 | ||||
| -rw-r--r-- | grammars/shell.bp | 4 |
10 files changed, 27 insertions, 27 deletions
diff --git a/grammars/c++.bp b/grammars/c++.bp index 843d42d..e8be4db 100644 --- a/grammars/c++.bp +++ b/grammars/c++.bp @@ -6,8 +6,8 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "//" .. $ / "/*" .. "*/" % \n -string: `"..`" % (`\.) +comment: "//" .. $ / "/*" ..%\n "*/" +string: `" ..%(`\.) `" keyword: |( "alignas" / "alignof" / "and" / "and_eq" / "asm" / "atomic_cancel" / "atomic_commit" / "atomic_noexcept" / "auto" / "bitand" / "bitor" / "bool" / "break" / "case" / "catch" / diff --git a/grammars/c.bp b/grammars/c.bp index e5066fa..e472a02 100644 --- a/grammars/c.bp +++ b/grammars/c.bp @@ -6,8 +6,8 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "//" .. $ / "/*" .. "*/" % \n -string: `"..`" % (`\.) +comment: "//" .. $ / "/*" ..%\n "*/" +string: `" ..%(`\.) `" keyword: |( "auto" / "break" / "case" / "char" / "const" / "continue" / "default" / "do" / "double" / "else" / "enum" / "extern" / "float" / "for" / "goto" / "if" / diff --git a/grammars/go.bp b/grammars/go.bp index 52abd64..01f983f 100644 --- a/grammars/go.bp +++ b/grammars/go.bp @@ -6,8 +6,8 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "//" .. $ / "/*" .. "*/" % \n -string: `"..`" % (`\.) +comment: "//" .. $ / "/*" ..%\n "*/" +string: `" ..%(`\.) `" keyword: |( "break" / "default" / "func" / "interface" / "select" / "case" / "defer" / "go" / "map" / "struct" / "chan" / "else" / "goto" / "package" / "switch" / "const" / diff --git a/grammars/html.bp b/grammars/html.bp index ab82f6f..483db6a 100644 --- a/grammars/html.bp +++ b/grammars/html.bp @@ -6,19 +6,19 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -doctype: "<!DOCTYPE" ..`> %\n +doctype: "<!DOCTYPE" ..%\n `> html-element: void-element / raw-element / template-element / normal-element void-element: `< ("area"/"base"/"br"/"col"/"embed"/"hr"/"img"/"input"/"link"/"meta"/"param"/"source"/"track"/"wbr") __attributes__ [`/] __ `> -template-element: "<template>".."</template>" % (\n / comment / html-element) +template-element: "<template>" ..%(\n / comment / html-element) "</template>" -raw-element: `< @tag=("script"/"style"/"textarea"/"title") __attributes__ `>..("</"tag__`>)%\n +raw-element: `< @tag=("script"/"style"/"textarea"/"title") __attributes__ `> ..%\n ("</"tag__`>) -normal-element: `< @tag=id __attributes__ `>..("</"tag`>) % (\n / comment / html-element) +normal-element: `< @tag=id __attributes__ `> ..%(\n / comment / html-element) ("</"tag`>) -comment: "<!--" .."-->" % \n +comment: "<!--" ..%\n "-->" attributes: *attribute%__ attribute: (+id%`:)__`=__ (id / string) diff --git a/grammars/javascript.bp b/grammars/javascript.bp index 49322c2..fa5c8d3 100644 --- a/grammars/javascript.bp +++ b/grammars/javascript.bp @@ -6,8 +6,8 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "//" .. $ / "/*" .. "*/" % \n -string: `"..`" % (`\.) / `'..`' % (`\.) / `/ .. `/ % (`\.) +comment: "//" .. $ / "/*" ..%\n "*/" +string: `" ..%(`\.) `" / `' ..%(`\.) `' / `/ ..%(`\.) `/ keyword: |( "abstract" / "arguments" / "await" / "boolean" / "break" / "byte" / "case" / "catch" / "char" / "class" / "const" / "continue" / "debugger" / "default" / @@ -21,4 +21,4 @@ keyword: |( )| function-def: |"function"| __ [id__] parens / (id / parens) __ "=>" function: function-def __ braces -import: |"import"| ..(`; / $) % braces +import: |"import"| ..%braces (`; / $) diff --git a/grammars/lisp.bp b/grammars/lisp.bp index a3e525c..25e2312 100644 --- a/grammars/lisp.bp +++ b/grammars/lisp.bp @@ -7,10 +7,10 @@ # See the accompanying README.md for more info. comment: ";" ..$ -string: `" .. `" % (`\.) +string: `" ..%(`\.) `" list: parens function-def: `(__"defun"|__id -function: function-def .. `) % parens +function: function-def ..%parens `) id-char: `A-Z,a-z,0-9,!,$,%,&,*,+,-,.,/,:,<,=,>,?,@,^,_,~ id: !<`A-Z,a-z,0-9,!,$,%,&,*,+,-,.,/,:,<,=,>,?,@,^,_,~ +`A-Z,a-z,0-9,!,$,%,&,*,+,-,.,/,:,<,=,>,?,@,^,_,~ |: !<`A-Z,a-z,0-9,!,$,%,&,*,+,-,.,/,:,<,=,>,?,@,^,_,~ / !`A-Z,a-z,0-9,!,$,%,&,*,+,-,.,/,:,<,=,>,?,@,^,_,~ diff --git a/grammars/lua.bp b/grammars/lua.bp index 7ffdc73..e8c9ba8 100644 --- a/grammars/lua.bp +++ b/grammars/lua.bp @@ -6,14 +6,14 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "--" (`[ @eqs=*`= `[ ..(`]eqs`]) % \n / ..$) -string: `"..`" % (`\.) / `'..`' % (`\.) / `[ @eqs=*`= `[ .. (`]eqs`]) % \n -table: `{..`} % (table/string/comment/\n) +comment: "--" (`[ @eqs=*`= `[ ..%\n (`]eqs`]) / ..$) +string: `"..%(`\.) `" / `' ..%(`\.) `' / `[ @eqs=*`= `[ ..%\n (`]eqs`]) +table: `{ ..%(table/string/comment/\n) `} keyword: |( "and" / "break" / "do" / "else" / "elseif" / "end" / "false" / "for" / "function" / "goto" / "if" / "in" / "local" / "nil" / "not" / "or" / "repeat" / "return" / "then" / "true" / "until" / "while" )| function-def: |"function"|[_id (*(`.id)[`:id])]_ parens -block: function / |("do"/"then")| .. (|"end"|) % (comment/string/block/\n) -function: function-def .. (|"end"|) % (comment/string/block/\n) +block: function / |("do"/"then")| ..%(comment/string/block/\n) (|"end"|) +function: function-def ..%(comment/string/block/\n) (|"end"|) diff --git a/grammars/python.bp b/grammars/python.bp index d6391bf..13c9251 100644 --- a/grammars/python.bp +++ b/grammars/python.bp @@ -7,7 +7,7 @@ # See the accompanying README.md for more info. comment: `# ..$ -string: "'''".."'''" % \n / '"""'..'"""' % \n / `"..`" % (`\.) / `'..`' % (`\.) +string: "'''" ..%\n "'''" / '"""' ..%\n '"""' / `" ..%(`\.) `" / `' ..%(`\.) `' keyword: |("and" / "as" / "assert" / "break" / "class" / "continue" / "def" / "del" / "elif" / "else" / "except" / "finally" / "for" / "from" / "global" / "if" / "import" / "in" / "is" / "lambda" / "None" / "nonlocal" / @@ -17,4 +17,4 @@ class: class-def +(\N ..$) class-def: ^_|"class"|_id[_parens]_`: function: function-def +(\N ..$) function-def: ^_|"def"|_id parens `: -import: ^_["from"| ..>(|"import"|)%parens] |"import"| ..$%parens +import: ^_["from"| ..%parens >(|"import"|)] |"import"| ..%parens $ diff --git a/grammars/rust.bp b/grammars/rust.bp index 003427a..3585732 100644 --- a/grammars/rust.bp +++ b/grammars/rust.bp @@ -6,8 +6,8 @@ # full parse tree, and having one makes the task considerably more complicated. # See the accompanying README.md for more info. -comment: "//" .. $ / "/*" .. "*/" % (comment / \n) -string: `"..`" % (`\.) +comment: "//" .. $ / "/*" ..%(comment / \n) "*/" +string: `" ..%(`\.) `" keyword: |( "as" / "break" / "const" / "continue" / "crate" / "else" / "enum" / "extern" / "false" / "fn" / "for" / "if" / "impl" / "in" / "let" / "loop" / "match" / diff --git a/grammars/shell.bp b/grammars/shell.bp index 2e2b60a..1ad182d 100644 --- a/grammars/shell.bp +++ b/grammars/shell.bp @@ -7,8 +7,8 @@ # See the accompanying README.md for more info. comment: `#..$ -string: `"..`" % (`\./subcommand/\n) / `'..`' % \n / "<<" _ @delim=id _$ ..(^delim$)%\n -subcommand: `` .. `` % \n / "$" parens +string: `" ..%(`\./subcommand/\n) `" / `' ..%\n `' / "<<" _ @delim=id _$ ..%\n (^delim$) +subcommand: `` ..%\n `` / "$" parens keyword: |( "echo" / "read" / "set" / "unset" / "readonly" / "shift" / "export" / "if" / "fi" / "else" / "while" / "do" / "done" / "for" / "until" / "case" / "esac" / "break" / |
