The return value is either 1 or -1, depending on the indicated sign.
i1 : (optionalSignParser @ constParser "abc" : charAnalyzer) "abc" o1 = (1, abc) o1 : Sequence |
i2 : (optionalSignParser @ constParser "abc" : charAnalyzer) "+abc" o2 = (1, abc) o2 : Sequence |
i3 : (optionalSignParser @ constParser "abc" : charAnalyzer) "-abc" o3 = (-1, abc) o3 : Sequence |
/usr/share/Macaulay2/Parsing.m2:157:31-157:135: --source code: optionalSignParser = Parser(c -> if c === null then 1 else if c === "-" then terminalParser(-1) else if c === "+" then terminalParser 1)
The object optionalSignParser is a parser.