diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-10 02:14:47 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-10 02:14:47 -0700 |
| commit | ace2f9f178dd25bee4d9de661050c7ca6a9187e6 (patch) | |
| tree | cd379d90245c0b4a29d59756632bb96708324960 /bpeg.bpeg | |
| parent | 8126489f81c37d6a8961f0f0e4f6193da38a4dc0 (diff) | |
Added escape ranges
Diffstat (limited to 'bpeg.bpeg')
| -rw-r--r-- | bpeg.bpeg | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -7,7 +7,7 @@ def = @[name]ref __ `= __ @[definition]extendedPat; # This is used for command line arguments: stringGrammar = *(`\ pat ?`; / .); -pat = empty / dot / string / charRange / char / escape / no / anythingBut +pat = empty / dot / string / charRange / char / escapeRange / escape / no / anythingBut / uptoAnd / repeat / after / before / capture / replace / ref / parens; empty = `/ >(__ (`}/`})); @@ -18,7 +18,9 @@ string = ( ); charRange = `` @[low]. `- @[high].; char = `` @[s].; -escape = `\ @[s]( +escapeRange = `\ @[low]escapeSequence `- @[high]escapeSequence; +escape = `\ @[s]escapeSequence; +escapeSequence = ( 1-3 `0-7 / `x 2 (`0-9/`a-f/`A-F) /`a/`b/`e/`n/`r/`t/`v / . / \n |
