Commit Graph
9 Commits
Author SHA1 Message Date
Evan Shaw 513af6df65 Fix precedence of % operator
It previously had the same precedence as + and -.
2015-01-22 09:49:53 +13:00
Evan Shaw 75d28c083c Don't treat negative numbers as literals
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.
2015-01-09 20:17:40 +13:00
Evan Shaw 648ee727a1 Fix style nits 2015-01-08 19:34:58 +13:00
Evan Shaw 68adc3f511 Use the return value of sprintf to avoid strlen calls 2015-01-08 13:46:33 +13:00
Evan Shaw 5261ef498f Optimize string methods for stored length
wrenStringConcat could still make use of this info, but that's a more involved
change.
2015-01-08 11:09:11 +13:00
Evan Shaw 3fd348e6c1 Store string length
Strings are still null-terminated so that they can be treated as C strings.
2015-01-08 10:05:51 +13:00
Evan Shaw 0d099933d6 Add myself to AUTHORS 2015-01-08 09:51:13 +13:00
Evan Shaw cb91bea6e7 Remove semi-colons from delta_blue.wren 2015-01-07 08:06:44 +13:00
Evan Shaw e3b5206ca8 Use a flexible array for strings 2015-01-06 19:08:42 +13:00