Commit graph

873 commits

Author SHA1 Message Date
Sei Lisa
12a1245102 Add ';' to the interning string table. 2014-07-27 01:28:35 +02:00
Sei Lisa
ecaa4b1af0 Output negative integers as hex. 2014-07-27 01:27:37 +02:00
Sei Lisa
e2918e7f05 Add constant NULL_KEY and function cond(). 2014-07-26 23:50:49 +02:00
Sei Lisa
a3354fae0e First steps in optimizer.
Still WIP, though, but it already optimizes e.g. this:

default { timer() { 2+2; } }

to this:

default { timer() { 4; } }
2014-07-26 21:32:01 +02:00
Sei Lisa
e8e411ad04 Fix thread safety of llList2CSV. 2014-07-26 21:25:06 +02:00
Sei Lisa
a3de885bf7 Move the functions that were scheduled to be moved. 2014-07-26 21:06:53 +02:00
Sei Lisa
4bff3aaf94 Thorough review of lslbasefuncs and associated files, adding new stuff.
- Scratch TODO item: Change shouldbeXXX to asserts.
  - shoudlbeXXX(x) has been turned into assert isXXX(x). Affects lsl2json too.

- New base functions:
  - compare (for == and !=)
  - less (for <, >, <=, >=)

- minus() renamed to neg() for consistency. Affects testfuncs too.

- add() now supports key+string and string+key.

- Allow integers in place of floats. That has caused the addition of three utility functions:
  - ff (force float)
  - v2f (force floats in all components of a vector)
  - q2f (force floats in all components of a quaternion)
  Used everywhere where necessary.

  Special care was taken in a few funcs (llListFindList and maybe others) to ensure that lists containing vectors or quaternions which in turn contain integer components, behave as if they were floats, because LSL lists can not physically hold integer values as components of vectors/quats.
  This also fixes a case where if a large integer had more precision than a F32 (e.g. 16777217), the product/division would be more precise than what LSL returns.

- Fix bugs of missing F32() in some places (llRotBetween, llEuler2Rot).

- Some functions marked for moving in an incoming commit.

- llList2CSV marked with a warning that it is not thread safe. That's a future TODO.

- Document llListFindList better.

- Make llListStatistics Use a more orthodox method to return the result for LIST_STAT_RANGE, LIST_STAT_MIN, LIST_STAT_MAX.

- Make llAxisAngle2Rot use more precision from llVecNorm, by adding an optional truncation parameter in the latter.

- Change order of some F32(Quaternion(...)) to not force so much instancing.

- Bugfix: llVecNorm did not return a Vector.
2014-07-26 20:54:01 +02:00
Sei Lisa
de4a8d4dac Add the Firestorm features as TODO tasks. 2014-07-26 04:57:58 +02:00
Sei Lisa
0959be94bc Add extra coverage case, as we were missing a few lines.
The option extendedglobalexpr shaded string juxtaposition in globals.
2014-07-26 04:51:35 +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
841413a2cf Remove bogus FIXME comment. 2014-07-26 04:35:57 +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
0b6ff4646e Add coverage tests for allowmultistrings, and reorder for coverage of the test program itself. 2014-07-26 03:57:02 +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
4ee320ace1 Add the unit testing files.
testfuncs.py uses custom testing functions.
testparser.py uses the unittest standard module.
2014-07-26 03:18:02 +02:00
Sei Lisa
07176278f8 Add current builtins.txt, which is needed to execute.
It's bound to become obsolete soon though, so check the kwdb repository for a fresh file.
2014-07-26 03:13:07 +02:00
Sei Lisa
5109fad261 Now that they're in the history, remove them 2014-07-26 03:10:30 +02:00
Sei Lisa
03cc7230c5 Add historic files for preservation 2014-07-26 03:08:19 +02:00
Sei Lisa
5810d0913a Meta - add .gitignore 2014-07-26 03:06:33 +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