Description Usage Arguments Value Examples
Returns the Status of a parsing result
1 | status(res)
|
A |
result from parsing, i.e. the result form applying a rule to a text string input. |
TRUE if successful, FALSE otherwise
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | parser<-new.parser()
#This rule to tests for string of a's followed by an equal number of b's
peg<-add_rule(parser, "S<-'a' S 'b'")
#test against 3 a's followed b 3 b's returns TRUE
apply_rule(parser, 'S', 'aaaabbbb')
status(res)
#test again with input of 3 a's followed bu 3 b's,
#this returns False
res<-apply_rule(parser, 'S', 'aaabbbb')
status(res)
See also
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.