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