Commit graph

22 commits

Author SHA1 Message Date
Sei Lisa
5d7829dc9d Fix a bunch of SEF-related bugs and forgotten cases. 2014-08-08 00:41:07 +02:00
Sei Lisa
7a6e13b786 Remove line that does nothing useful. 2014-08-07 22:10:15 +02:00
Sei Lisa
58e22f77ce Prepare for the incoming Dead Code Removal module. 2014-08-05 15:47:14 +02:00
Sei Lisa
67f3061e19 Fix state switch error reporting bug. Add 'Not all code paths...' error.
Add corresponding tests too. Simplify the identifier renaming coverage test. Also remove extra newlines from library reading code.

We've had to give up on the 'else if' loop-instead-of-recurse optimization, to properly propagate the LastWasReturn flag.
2014-08-03 04:50:18 +02:00
Sei Lisa
400809671e Fix GetNextShortest. Add test and regression cases. Rename AssignNewNames. 2014-08-01 18:02:55 +02:00
Sei Lisa
e29f16d3eb Add duplabels option (not yet implemented).
When disabled, it now disallows duplicate labels. The plan is that when enabled, it will auto-rename labels so that there are no repetitions within a function.

Add coverage tests too, and also a coverage test that was missed after the latest changes.
2014-08-01 00:33:20 +02:00
Sei Lisa
a303ef2066 Unfold all assignment+operation operators to optimize them better.
With test case.
2014-07-31 18:44:50 +02:00
Sei Lisa
66417276ae Test cases for the previous commit 2014-07-31 03:31:42 +02:00
Sei Lisa
6ec39aa745 Add a bunch of optimizations. Fix || and && results.
Notably, addition/subtraction, and llGetListLength -> !=[]

But also parenthesis removal etc.

With test coverage.
2014-07-31 02:53:51 +02:00
Sei Lisa
fb68273eed Turned everything upside down, and fixed a couple bugs.
Bugs fixed:
- %= and the new assignment operators were not emitting error on invalid types.
- List globals referenced in another global were duplicated entirely.
- Properly recognize -option in the command line.

Rest:
- Complete overhaul of the internal data structure.
  - Got rid of the symbol table plus mini-trees, and made everything one big tree plus an auxiliary symbol table.
  - No more special case hacks like using tuples instead of lists...
  - Got rid of the EXPR hack.
  - Dict-based, rather than list-based. Allows adding arbitrary data to any node or symbol entry.
- Added a few coverage tests for the new code.
- Return values can now be chained; the functions parameter requirement is gone. Still not fully convinced, though. My guess is that a parser object should be passed between functions instead. Will do for now.
2014-07-30 04:54:16 +02:00
Sei Lisa
3b4bf13a10 Add coverage for new stuff. 2014-07-28 21:19:23 +02:00
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
6c00400d7d Add coverage for new preprocessor option. 2014-07-28 02:45:30 +02:00
Sei Lisa
ae94e80c34 Add a regression test for a case that failed before the globals fix. 2014-07-28 01:01:10 +02:00
Sei Lisa
1747028211 Finish coverage tests. 2014-07-27 20:26:24 +02:00
Sei Lisa
19ca34d7e0 Expand the test case to include more coverage. Triggers errors. 2014-07-27 20:13:12 +02:00
Sei Lisa
716374eb83 Add test cases that failed without the previous commit. 2014-07-27 18:08:18 +02:00
Sei Lisa
f5444bb83d Update coverage tests. Add optimizer test. Rename classes (cosmetic). 2014-07-27 13:52:55 +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
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
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
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