Updated to use `a,b,c

This commit is contained in:
Bruce Hill 2020-12-19 19:04:21 -08:00
parent c28e647259
commit 177bc55cfc
2 changed files with 17 additions and 16 deletions

View File

@ -10,7 +10,7 @@ Def: @name=id _ `: __ (
String-pattern: ... % (Nodent / Escape / `\ pat [`;])
pat: simple-pat !(__("!="/"==")) / suffixed-pat
simple-pat: Upto-and / Dot / String / Char-range / Char / Nodent / Escape-range
simple-pat: Upto-and / Dot / String / Chars / Nodent / Escape-range
/ Escape / Repeat / Optional / After / Before / Capture / Replace
/ Ref / parens
@ -27,17 +27,18 @@ String: (
`" @s=*(Escape / !`".) (`" / @!={=> "Expected closing quote here"})
/ `' @s=*(Escape / !`'.) (`' / @!={=> "Expected closing quote here"})
)
Char-range: `` @low=. `- (@high=. / @!={=> "Expected a second character to form a character range"})
Char: `` (@s=. / @!={=> "Expected a character following the '`'"})
Chars: `` @+(Char/Char-range) % `,
Char-range: @low=. `- (@high=. / @!={=> "Expected a second character to form a character range"})
Char: (@s=. / @!={=> "Expected a character following the '`'"})
Escape-range: `\ @low=escape-sequence `- @high=escape-sequence
Escape: `\ (@s=escape-sequence
/ $ @!={=>"Backslashes are used for escape sequences, not splitting lines"}
/ @!={. *(Abc/`0-9) => "Invalid escape sequence: '@0'"}
)
escape-sequence: (
`n/`t/`r/`e/`b/`a/`v
`n,t,r,e,b,a,v
/ 1-3 `0-7
/ `x 2 (`0-9/`a-f/`A-F)
/ `x 2 `0-9,a-f,A-F
)
No: `! (_@pat / @!={=>"Expected a pattern after the exclamation mark"})
Nodent: `\ `N
@ -71,7 +72,7 @@ $: !.
^^: !<$.
^: !<.
id: "^^" / "^" / "__" / "_" / "$$" / "$" / "|" / (`a-z/`A-Z) *(`a-z/`A-Z/`0-9/`-)
id: "^^" / "^" / "__" / "_" / "$$" / "$" / "|" / `a-z,A-Z *`a-z,A-Z,0-9,-
line-comment: `# .. $
block-comment: "#("..")#" % block-comment

View File

@ -35,8 +35,8 @@ url-path: +(`/ *url-char) [`? +(+url-char`=+url-char)%`&]
ipv4: 4 int % `.
ipv6: 8 (4 Hex) % `:
domain: +(+(Abc/digit/`-))%`.
url-char: Abc/digit/`$/`-/`_/`./`+/`!/`*/`'/`(/`)/`,/`%
email: +(Abc/digit/`./`-/`+) `@ domain
url-char: Abc/digit/`$,-,_,.,+,!,*,',(,),,,%
email: +(Abc/digit/`.,-,+) `@ domain
nodent: \N !(\t/` )
indent: \N (` /\t)
@ -54,17 +54,17 @@ brackets: `[...`] % (brackets/string)
braces: `{...`} % (braces/string)
parens: `(...`) % (parens/string)
string: `"..`" % (`\.) / `'..`' % (`\.)
id: !<(`a-z/`A-Z/`_/`0-9) (`a-z/`A-Z/`_) *(`a-z/`A-Z/`_/`0-9)
id-char: `a-z/`A-Z/`_/`0-9
word: !<(`a-z/`A-Z/`_/`0-9) +(`a-z/`A-Z) !>(`0-9/`_)
|: !<(`a-z/`A-Z/`_/`0-9) / !>(`0-9/`_)
HEX: `0-9/`A-F
Hex: `0-9/`a-f/`A-F
hex: `0-9/`a-f
id: !<`a-z,A-Z,_,0-9 `a-z,A-Z,_ *`a-z,A-Z,_,0-9
id-char: `a-z,A-Z,_,0-9
word: !<`a-z,A-Z,_,0-9 +`a-z,A-Z !>`0-9,_
|: !<`a-z,A-Z,_,0-9 / !>`a-z,A-Z,_,0-9
HEX: `0-9,A-F
Hex: `0-9,a-f,A-F
hex: `0-9,a-f
number: +`0-9 [`. *`0-9] / `. +`0-9
int: +`0-9
digit: `0-9
Abc: `a-z/`A-Z
Abc: `a-z,A-Z
ABC: `A-Z
abc: `a-z
esc: \e