status: Returns the Status of a parsing result

Description Usage Arguments Value Examples

View source: R/status.R

Description

Returns the Status of a parsing result

Usage

1
status(res)

Arguments

A

result from parsing, i.e. the result form applying a rule to a text string input.

Value

TRUE if successful, FALSE otherwise

Examples

 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

mslegrand/pegr documentation built on May 23, 2019, 7:53 a.m.