Commit graph

24 commits

Author SHA1 Message Date
Sei Lisa
231c16b90e New copyright year 2023-02-03 13:06:18 +01:00
Sei Lisa
b13bb6d810 Add LinkSound functions and constants; disallow unstable in void
The unstable flag does not make sense in void functions; add warning.

Also, new upstream version of builtins.txt with new functions that have been added to fndata.txt.
2023-02-03 12:57:58 +01:00
Sei Lisa
91b3186245 Microoptimizations; minor fix
The microoptimizations do nothing at all, but it was poor style before them.

The fix is a missing u for a Unicode string.
2023-01-31 20:41:37 +01:00
Sei Lisa
8e20a06912 Other minor fixes to lslloadlib
Fix many comparisons of unicode to str.
2023-01-09 11:12:20 +01:00
Sei Lisa
e3c1634724 Fix regression introduced with the latest changes to loadlib
In Python 2, function type names from buiiltins.txt were entered into the tables as Unicode, causing the output module to promote strings to Unicode, and causing trouble further down the line.

Entering them as str fixes the issue.

Thanks a lot to @PeterStindberg for reporting the issue and providing a script that reproduces it.

Fixes #21
2023-01-09 11:03:41 +01:00
Sei Lisa
cc55c4c23e Revamp encoding handling in lslloadlib
There were multiple encoding issues, especially on Windows. Address them by loading the file in binary and converting to Unicode for internal use. This means that the function/event tables are now Unicode.

Originally reported by @Tonaie (see #20).
2022-12-08 17:19:19 +01:00
Sei Lisa
8d413f910e Forgot to update copyright year 2022-06-07 19:46:31 +02:00
Sei Lisa
81906475ff Update copyright year 2021-01-05 23:27:21 +01:00
Sei Lisa
16d8c4c9d1 More progress in migration to dual Python 2&3. Just 2 tests left. 2020-11-10 00:15:48 +01:00
Sei Lisa
f8cf78dfac Progress towards dual Python 2 & 3 2020-11-09 02:28:57 +01:00
Sei Lisa
234b9b23a3 Bump copyright year 2020-04-23 00:38:20 +02:00
Sei Lisa
fe2dd9a721 First baby steps towards dual Python2+3 compatibility 2019-01-16 00:15:06 +01:00
Sei Lisa
f243f3a3c1 New copyright year 2019-01-01 22:54:34 +01:00
Sei Lisa
0855b8ad1d Add 'listto' to fndata.txt; remove more magic names from the code
Rather than using a hardcoded table of list-to-type extraction function, add a 'ListTo' attribute to the function data. No error is raised if more than one function exists to convert to the same type.

This change is of questionable usefulness, but it should soothe those allergic to magic names/numbers. I cringed a bit myself.

While on it, change the syntax error that was raised when the corresponding conversion function did not exist, to a tailor-made error.
2018-12-22 15:44:14 +01:00
Sei Lisa
d0d6d6744b Bump copyright year
The help text in main.py was still at 2015. Oops.
2018-03-23 16:36:45 +01:00
Sei Lisa
14b13dc4e5 Implement flags aimed at removing "magic names" in the code.
strlen for llStringLength, detect for llDetected* and touch*/collision*/sensor, touch for touch*, grab for touch().
2017-10-27 18:49:58 +02:00
Sei Lisa
d5f5ab8b88 Add side-effect-free information for events. 2017-10-25 17:46:50 +02:00
Sei Lisa
2d823d8eae Fix Unicode in one error message. 2017-10-25 14:11:34 +02:00
Sei Lisa
a832f8d786 Remove min, max when min > max, and SEF when both SEF and delay present. 2017-10-21 11:47:29 +02:00
Sei Lisa
cdacc45bb0 Make functions unstable by default, for safety.
That ensures that if there's no data about a function, it is not optimizable.
2017-10-21 10:32:56 +02:00
Sei Lisa
ee8c2cde98 Cosmetic fixes. 2017-10-21 10:32:41 +02:00
Sei Lisa
b7700b7aab Remove debug code and seftable.txt 2017-10-21 10:29:12 +02:00
Sei Lisa
214d4a8a57 Add and read function properties table.
This solves a long-standing issue where we needed more data about LSL functions than just whether it's side-effect-free.

There's still some debug code, which is kept for history purposes.
2017-10-21 10:00:31 +02:00
Sei Lisa
3f6f8ed8ad Internal code reorganization.
- Separate library loading code into a new module. parser.__init__() no longer loads the library; it accepts (but does not depend on) a library as a parameter.
- Add an optional library argument to parse(). It's no longer mandatory to create a new parser for switching to a different builtins or seftable file.
- Move warning() and types from lslparse to lslcommon.
- Add .copy() to uses of base_keywords, to not rely on it being a frozen set.
- Adjust the test suite.
2017-10-20 18:19:48 +02:00