Skip to content

Commit 2b02299

Browse files
committed
Updated cpp-peglib.peg
1 parent 5ef7180 commit 2b02299

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

grammar/cpp-peglib.peg

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,30 @@ Primary <-
2424
/ BeginTok Expression EndTok
2525
/ BeginCapScope Expression EndCapScope
2626
/ BeginCap Expression EndCap
27+
/ CapScope
2728
/ BackRef
29+
/ DictionaryI
2830
/ LiteralI
2931
/ Dictionary
3032
/ Literal
3133
/ NegatedClassI
3234
/ NegatedClass
3335
/ ClassI
3436
/ Class
35-
/ DOT
37+
/ DOT
3638

3739
Identifier <- IdentCont Spacing
3840

39-
IdentCont <- IdentStart IdentRest*
41+
IdentCont <- <IdentStart IdentRest*>
4042

4143
IdentStart <- !"↑" !"⇑" ([a-zA-Z_%] / [\u0080-\uFFFF])
4244

4345
IdentRest <- IdentStart / [0-9]
4446

4547
Dictionary <- LiteralD (PIPE LiteralD)+
4648

49+
DictionaryI <- LiteralID (PIPE LiteralID)*
50+
4751
lit_ope <-
4852
['] <(!['] Char)*> ['] Spacing
4953
/ ["] <(!["] Char)*> ["] Spacing
@@ -52,10 +56,14 @@ Literal <- lit_ope
5256

5357
LiteralD <- lit_ope
5458

55-
LiteralI <-
59+
lit_case_ignore_ope <-
5660
['] <(!['] Char)*> "'i" Spacing
5761
/ ["] <(!["] Char)*> '"i' Spacing
5862

63+
LiteralI <- lit_case_ignore_ope
64+
65+
LiteralID <- lit_case_ignore_ope
66+
5967
# NOTE: The original Brian Ford's paper uses 'zom' instead of 'oom'.
6068
Class <- '[' !'^' <(!']' Range)+> ']' Spacing
6169
ClassI <- '[' !'^' <(!']' Range)+> ']i' Spacing
@@ -82,6 +90,8 @@ RepetitionRange <-
8290

8391
Number <- [0-9]+ Spacing
8492

93+
CapScope <- BeginCapScope Expression EndCapScope
94+
8595
LEFTARROW <- ("<-" / "←") Spacing
8696

8797
~SLASH <- '/' Spacing

0 commit comments

Comments
 (0)