mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 05:15:30 +00:00
Updated cpp-peglib.peg
This commit is contained in:
parent
5ef7180a12
commit
2b022992a4
@ -24,7 +24,9 @@ Primary <-
|
||||
/ BeginTok Expression EndTok
|
||||
/ BeginCapScope Expression EndCapScope
|
||||
/ BeginCap Expression EndCap
|
||||
/ CapScope
|
||||
/ BackRef
|
||||
/ DictionaryI
|
||||
/ LiteralI
|
||||
/ Dictionary
|
||||
/ Literal
|
||||
@ -32,11 +34,11 @@ Primary <-
|
||||
/ NegatedClass
|
||||
/ ClassI
|
||||
/ Class
|
||||
/ DOT
|
||||
/ DOT
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user