skx / marionette

Something like puppet, for the localhost only.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Negative numbers aren't parsed

skx opened this issue · comments

I don't know that we really need them, but I did spot that negative numbers aren't parsed correctly.

Consider this input:

let h = `hostname`

#
# Pick a number from -100 to 100
#
let rand1 = rand(-100, 100)

#
# These two should match - since `${HOSTNAME}` should
# match the output of `hostname`.
#
let rand2 = rand(1, 100, "${HOSTNAME}")
let rand3 = rand(1, 100, "${h}")

fail { message => "Random numbers differ, despite same seed!",
       unless => equal( "${rand2}", "${rand3}" ) }

This results in a parse-failure:

frodo ~/Repos/github.com/skx/marionette $ go build . && ./marionette rand.in 
Error:unexpected bare identifier -100