Fixes#93.
Previously, "1 -1" was lexed as two number tokens: a positive literal and
a negative literal. This caused problems when it came to parsing.
Now the '-' and the second number are separate tokens.
Note this is a breaking change, since `-16.sqrt` is now parsed as `-(16.sqrt)`,
as opposed to `(-16).sqrt`.
There is a small bit of overhead to doing it this way, but it might be possible
to optimize that out in the compiler at some point in the future.
- Primitives can now signal an error.
- An error prints a callstack and ends the current (and right
now only) fiber.
- Arithmetic operators error if the operand is not a number.
- Real error for method not found.
- Associate source file name, and method names with functions.
- Debug line number info for functions.
Unfortunately, this regresses perf on fib about 15%, mostly
because of the better checking in arithmetic ops.
There's still a bunch of clean up to do, but this is a big step
in the right direction.
Added ".." and "..." infix operators. Num implements them to
return Range objects. Those in turn implement the iterator
protocol, so now numeric for loops are easy:
for (i in 1..10) { ... }
I also cleaned up the Wren benchmarks to use this.
In the process, I discovered the method_call benchmark really
just showed loop peformance, so I unrolled the loops in all of
the languages to stress method calls.