Commit graph

117 commits

Author SHA1 Message Date
Sei Lisa
56d51b835c Hack to make identifiers in globals in non-global-expression mode work. 2014-07-28 19:20:36 +02:00
Sei Lisa
eab0bec84b Add preprocessor skip option, command line options and help, options for all functions, and enhance parentheses removal. 2014-07-28 02:13:08 +02:00
Sei Lisa
8907a59d5f Fix remaining bug in optimizer, and minor fixes.
- Get rid of Fold().

- Handle globalmode properly. It was sometimes active during function calls.

- Change all warning() calls to not use Unicode, just in case the output is redirected to file.

- Cosmetic fixes and TODO items.
2014-07-27 23:33:20 +02:00
Sei Lisa
dde3c08f61 Add TODO item: skip preprocessor directives. 2014-07-27 21:05:01 +02:00
Sei Lisa
30efb5d14c Bug fix: look up library functions too! 2014-07-27 19:18:05 +02:00
Sei Lisa
f3339b0906 Fix an infinite recursion by disallowing forward globals in global var defs. 2014-07-27 18:42:55 +02:00
Sei Lisa
124a2823a0 builtins.txt was not named as the source of some errors. Fixed. 2014-07-27 13:49:18 +02:00
Sei Lisa
cef3e626a9 Associate identifiers with their direct location.
Instead of returning the scope level at which search can start, return the scope level at which the symbol actually is.
2014-07-27 01:49:44 +02:00
Sei Lisa
12a1245102 Add ';' to the interning string table. 2014-07-27 01:28:35 +02:00
Sei Lisa
de4a8d4dac Add the Firestorm features as TODO tasks. 2014-07-26 04:57:58 +02:00
Sei Lisa
8078be8401 Cosmetic: make another comment clearer 2014-07-26 04:45:56 +02:00
Sei Lisa
cfa7e1de89 Cosmetic: make a comment clearer 2014-07-26 04:44:02 +02:00
Sei Lisa
e03b342f78 Allow concatenation of key+string and string+key producing string.
Also add corresponding test cases, making some mostly cosmetic changes to the test program while on it.
2014-07-26 04:41:09 +02:00
Sei Lisa
0b49a9590f Delete options when no longer necessary. 2014-07-26 04:01:12 +02:00
Sei Lisa
b36356db45 Change default options set to frozenset, and add a TODO.
Not convinced a set is the way to go here, though, given it's checked at the beginning only.
2014-07-26 03:59:35 +02:00
Sei Lisa
a46c5463eb Add 'allowmultistrings' option.
This option enables a C-style feature where strings can be composed by juxtaposing them, like this: "blah" "another" in the input program becomes "blahanother" in the output.
2014-07-26 03:44:48 +02:00
Sei Lisa
05d00e075b Initial commit. Status so far:
- Parser and output modules are thoroughly tested and working.
- Most LSL immutable functions are working; some not tested; llJsonSetValue not implemented.
- Parser recognizes the following flags that alter syntax:
   extendedglobalexpr: Allow full expression syntax in globals.
   extendedtypecast: Allow full unary expressions in typecasts e.g. (float)~i.
   extendedassignment: Enable the C assignment operators &=, ^=, |=, <<=, >>=.
   explicitcast: Add explicit casts wherever they are done implicitly, e.g. float f=3; -> float f=(float)3;.
  Of them, only extendedglobalexpr is useless so far, as it requires the optimizer to be working.
2014-07-26 02:43:44 +02:00