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

QQParser -- a parser that accepts (and returns) a rational number, one character at a time

Description

The denominator must be present.

i1 : (QQParser : charAnalyzer) "-123456789/54321"

       41152263
o1 = - --------
         18107

o1 : QQ

Code

../Parsing.m2:94:52-94:121: --source code:
Function % Parser := (fun,p) -> new Parser from ( c -> if (p' := p c) =!= null then if c === null then fun p' else fun % p' )
| symbol  class            value                                      location of symbol
| ------  -----            -----                                      ------------------       
| p       Parser           -*Function[../Parsing.m2:102:54-114:83]*-  ../Parsing.m2:94:26-94:27
| fun     FunctionClosure  -*Function[../Parsing.m2:163:25-163:32]*-  ../Parsing.m2:94:22-94:25

See also

For the programmer

The object QQParser is a parser.