Description Usage Arguments Details See Also Examples
Sets restriction on the maximum call depth of rules
1 | set_rule_stack_limit(pegR, stop.level.limit)
|
parser, |
a peg parser produced by new.parser |
stop.level.limit, |
a restriction on the number of calls (levels) before stopping a parse |
Since a rule can call other rules or even itself, the depth
of a calling sequence can grow and potentially be
infinited. By setting the stop level one is restricting
that depth, and hence can detect possible infinite
recursive calls. To inspect the calling sequence of those
rules when the max depth of the rule stack is exceed, use
get_rule_stack
get_rule_stack
,
unset_rule_stack_limit
1 2 3 4 5 6 7 | ## Not run:
peg<-new.parser()
set_rule_stack_limit(peg, 10)
peg<-add_rule(peg, "A<-A" ) #an infinite recursive call
apply_rule(peg, "A", "x") #the input is irrevelant, throws error
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.