danvim / ProcalParsing

0 stars 2 forks source link

floor and ceiling #15

Closed mcreng closed 7 years ago

mcreng commented 7 years ago

Input

  1. Floor(2)
  2. Ceiling(2)
  3. Ceiling(3.8)
  4. Rnd_Up(3.8)
  5. Rnd_Down(3.8)

Errors

  1. Error: Lexing failed: 'No matching rule' @ position 1:7 (index 6): last lexeme was 'lparen(()', remaining text is '2):'
  2. Error: Lexing failed: 'No matching rule' @ position 1:9 (index 8): last lexeme was 'lparen(()', remaining text is '2):'
  3. Error: Parsing failed: 'Current lexeme does not support nud parsing' @ position 1:1 (index 0), current lexeme is combination(C), previous was null, and remaining are [function(eiling), lparen((), number(3.8), rparen()), colon(:), END]
  4. Error: Lexing failed: 'No matching rule' @ position 1:4 (index 3): last lexeme was 'suffixFunction(Rnd)', remaining text is '_Up(3.8):'
  5. Similar error to above
mcreng commented 7 years ago

It was parsed as nCr for Ceiling() and Rnd() for Rnd_Down() and Rnd_Up(). And for Floor(), it just doesn't support integer for some reason. It works fine for something like Floor(3.8).

danvim commented 7 years ago

The integer issue is most likely related to #12 where I missed \\d+ in the regex in that commit. Ceiling however, should be fixed in commit ada376593bd6a76d348f57d3188cac711330bd33.

mcreng commented 7 years ago

Rnd_Up() and Rnd_Down() still doesn't work in commit https://github.com/danvim/ProcalParsing/commit/ada376593bd6a76d348f57d3188cac711330bd33.

danvim commented 7 years ago

Sorry, the commit should be: 04223609bcc615b921c84ae06ff24722ae2d0bc1