next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
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

See also

Code

../Parsing.m2:91:53-91:122: --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
| ------   -----              -----                                     ------------------       
| fun    : FunctionClosure -- {*Function[../Parsing.m2:161:25-161:32]*} ../Parsing.m2:91:23-91:25
| p      : Parser          -- {*Function[../Parsing.m2:99:54-111:83]*}  ../Parsing.m2:91:27-91:27