justinmeza / lci

A LOLCODE interpreter written in C.
http://lolcode.org
GNU General Public License v3.0
780 stars 105 forks source link

Octal NUMBR works when negative, but not positive #57

Open sjoqvist opened 5 years ago

sjoqvist commented 5 years ago

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.

sjoqvist commented 5 years ago

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