next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Parsing > Parser > optP

optP -- making a parser optional

Synopsis

Description

After the first token, the parser is no slower than p would have been.

i1 : (optP constParser "abc" : charAnalyzer) "abc"

o1 = abc
i2 : (optP constParser "abc" : charAnalyzer) ""

o2 = nil

o2 : Symbol

See also

For the programmer

The object optP is a function closure.