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

letterParser -- a parser that accepts a single letter and returns it

Description

i1 : p = letterParser "a"

o1 = p

o1 : Parser
i2 : p "b"
i3 : p null

o3 = a

Code

../../../../../../../Macaulay2/packages/Parsing.m2:63:26-63:87: --source code:
letterParser = Parser (c -> if alpha#?c then new Parser from (b -> if b === null then c))

For the programmer

The object letterParser is a parser.