Updated cpp-peglib.peg

This commit is contained in:
yhirose 2024-09-01 15:53:10 -04:00
parent 5ef7180a12
commit 2b022992a4

View File

@ -24,7 +24,9 @@ Primary <-
/ BeginTok Expression EndTok
/ BeginCapScope Expression EndCapScope
/ BeginCap Expression EndCap
/ CapScope
/ BackRef
/ DictionaryI
/ LiteralI
/ Dictionary
/ Literal
@ -36,7 +38,7 @@ Primary <-
Identifier <- IdentCont Spacing
IdentCont <- IdentStart IdentRest*
IdentCont <- <IdentStart IdentRest*>
IdentStart <- !"↑" !"⇑" ([a-zA-Z_%] / [\u0080-\uFFFF])
@ -44,6 +46,8 @@ IdentRest <- IdentStart / [0-9]
Dictionary <- LiteralD (PIPE LiteralD)+
DictionaryI <- LiteralID (PIPE LiteralID)*
lit_ope <-
['] <(!['] Char)*> ['] Spacing
/ ["] <(!["] Char)*> ["] Spacing
@ -52,10 +56,14 @@ Literal <- lit_ope
LiteralD <- lit_ope
LiteralI <-
lit_case_ignore_ope <-
['] <(!['] Char)*> "'i" Spacing
/ ["] <(!["] Char)*> '"i' Spacing
LiteralI <- lit_case_ignore_ope
LiteralID <- lit_case_ignore_ope
# NOTE: The original Brian Ford's paper uses 'zom' instead of 'oom'.
Class <- '[' !'^' <(!']' Range)+> ']' Spacing
ClassI <- '[' !'^' <(!']' Range)+> ']i' Spacing
@ -82,6 +90,8 @@ RepetitionRange <-
Number <- [0-9]+ Spacing
CapScope <- BeginCapScope Expression EndCapScope
LEFTARROW <- ("<-" / "←") Spacing
~SLASH <- '/' Spacing