Macaulay2 » Documentation
Packages » Parsing » Parser » terminalParser
next | previous | forward | backward | up | index | toc

terminalParser -- produce a parser in a terminal state

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:17-59:69: --source code:
terminalParser = val -> new Parser from (c -> if c === null then val)

For the programmer

The object terminalParser is a function closure.


The source of this document is in Parsing.m2:300:0.