Commit Graph
5 Commits
Author SHA1 Message Date
Matouš Jan FialkaandGitHub cd6f4e9c58 Space Lua: Align .. (concatenation) operator (#1648)
* Make fallback accept only strings and numbers (as per standard Lua).

* Remove `luaToString` from the fallback. It fits well presentation
  purposes but is too complicated for strict semantic checking in the
  evaluator and also wrongly coersed non-string and non-number value.
  It may also return a promise but we require synchronous error path.

* Concatenating `nil` now throws "attempt to concatenate nil value" as
  per standard Lua.

* Other types throw "attempt to concatenate a non-string or non-number"
  which is simplified message diverting from standard Lua which throws
  typed error but we do not strictly need that for Space Lua (and can be
  easily added anytime in the future).

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-22 10:41:26 +02:00
Matouš Jan FialkaandGitHub 4b9829c59c Space Lua: Add rawget and rawequal functions (#1647)
Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-21 13:41:36 +02:00
Matouš Jan FialkaandGitHub 9292ae4b74 Space Lua: Align length features with standard Lua (#1637)
* Align `#` operator and `__len` metamethod with Lua and add `rawlen` function

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-21 09:55:38 +02:00
Matouš Jan FialkaandGitHub 80f31da16b Fix arithmetic coercion - refactored and enhanced (#1576)
The Lua 5.4 compatible `tonumber` implementation completely reworked

- custom char-by-char parser (no regexes)
- proper Lua space handling
- support for heximal integers and floats
- support for scientific float notation
- extended tests
- updated website docs

Signed-off-by: Matouš Jan Fialka <mjf@mjf.cz>
2025-10-01 11:30:58 +02:00
Zef Hemel f4336bf09f Code restructuring: eliminated the top-level lib/ directory 2025-09-23 17:00:34 +02:00