next | previous | forward | backward | up | top | index | toc | home
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:56
letterParser = Parser (c -> if alpha#?c then new Parser from (b -> if b === null then c))