You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The former finds the first Pair that has the type Rule::SomeRule, while the latter does the same if the matched content = &str. max_level and min_level work to limit the search just like in Unix find command; Setting 0 means no limit.
In addition, it'd be nice to have the following stack functions:
IS_EMPTY: Match without progress if the stack is empty. CONTAINS("abc") : Match without progress if the stack contains the string "abc".
The benefit of the stack functions is shown by the following example.
Int = @{ ASCII_DIGIT+ }
Word = @{ ASCII_ALPHA+ }
Defn = { COLON ~ Word ~ "=" ~ Int ~ SEMICOLON }
When the rule Int or Word is encountered, the program prints the value. When the rule Defn is encountered, the program simply stores the definition for future use. When we are parsing Defn, we don't want the Int and Word rules to fire and start printing. If there was an IS_EMPTY, we could've used it along with PUSH to stop the Int and Word from firing.
The text was updated successfully, but these errors were encountered:
It'd be nice to have the following functions for
Pairs
to reduce the deep nesting:The former finds the first
Pair
that has the typeRule::SomeRule
, while the latter does the same if the matched content =&str
.max_level
andmin_level
work to limit the search just like in Unixfind
command; Setting0
means no limit.In addition, it'd be nice to have the following stack functions:
IS_EMPTY
: Match without progress if the stack is empty.CONTAINS("abc")
: Match without progress if the stack contains the string "abc".The benefit of the stack functions is shown by the following example.
When the rule
Int
orWord
is encountered, the program prints the value. When the ruleDefn
is encountered, the program simply stores the definition for future use. When we are parsingDefn
, we don't want theInt
andWord
rules to fire and start printing. If there was anIS_EMPTY
, we could've used it along withPUSH
to stop theInt
andWord
from firing.The text was updated successfully, but these errors were encountered: