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

terminalParser -- produce a parser in a terminal state

Synopsis

Description

i1 : p = terminalParser x

o1 = p

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

o3 = x

o3 : Symbol

Code

../../../../../../../Macaulay2/packages/Parsing.m2:59:22-59:66: --source code:
terminalParser = val -> new Parser from (c -> if c === null then val)

For the programmer

The object terminalParser is a function closure.