justinmeza/lci

Octal NUMBR works when negative, but not positive

Opened this issue · 1 comments

The following program returns -8.

HAI 1.2
  VISIBLE -010
KTHXBYE

But the following yields the error message test.lol:2: unknown token at: 010.

HAI 1.2
  VISIBLE 010
KTHXBYE

I would have expected octal input to work with neither or both.

A similar difference between negative and positive is the following. This program returns -0.10.

HAI 1.2
  VISIBLE -.1
KTHXBYE

But when made positive, you get the error message test.lol:2: unknown token at: .1.

HAI 1.2
  VISIBLE .1
KTHXBYE

Also worth noting is the following, which yields test.lol:2: expected floating point decimal value.

HAI 1.2
  VISIBLE -.
KTHXBYE