aboutsummaryrefslogtreecommitdiff
path: root/grammars
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-05-20 16:46:14 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-05-20 16:46:14 -0700
commitec1a3e08354d27742e89fd8437a5a1d39153c53e (patch)
treeb6d434441179ba090da89b83a34ad243ba9215a9 /grammars
parentcd30e89042f820c7e6dc7c40890eb21ddf0cd94f (diff)
Fixes for char sets/ranges and cleanups
Diffstat (limited to 'grammars')
-rw-r--r--grammars/bp.bp2
-rw-r--r--grammars/builtins.bp3
2 files changed, 2 insertions, 3 deletions
diff --git a/grammars/bp.bp b/grammars/bp.bp
index fc1e794..228f7d0 100644
--- a/grammars/bp.bp
+++ b/grammars/bp.bp
@@ -5,7 +5,7 @@
# The grammar files provided with BP are not otherwise intended to be full
# language grammars.
-Grammar: __ *(Def [__`;])%__ __ ($$ / (!)(..%\n$$ => "Could not parse this code"))
+Grammar: __ *(Def [__`;])%__ __ [(!)(+(./\n) => "Could not parse this code")]
Def: @name=id __ `: __ (
@definition=extended-pat
/ $$ (!)=>"No definition for rule"
diff --git a/grammars/builtins.bp b/grammars/builtins.bp
index cf642e2..888cc2c 100644
--- a/grammars/builtins.bp
+++ b/grammars/builtins.bp
@@ -17,8 +17,7 @@ braces: `{ ..%(\n/braces/string) `}
parens: `( ..%(\n/parens/string) `)
string: `" ..%string-escape `" / `' ..%string-escape `'
string-escape: `\ (`x 2 Hex / 1-3 `0-7 / `u 1-4 Hex / .)
-left-id-edge: ^ / <(\x00-x7f!~(^^id-char)) / <((\xc0-xdf \x80-xbf)!~(^^id-char))
- / <((\xe0-xef 2\x80-xbf)!~(^^id-char)) / <((\xf0-xf7 3\x80-xbf)!~(^^id-char))
+left-id-edge: !<id-char
right-id-edge: !id-char
id: left-id-edge !`0-9 !(keyword left-id-edge) +id-char
id-char: `a-z,A-Z,_,0-9