Skip to content

Releases: bananu7/Turnip

Improved REPL & command line

15 Aug 17:15
Compare
Choose a tag to compare
Pre-release

This is a relatively minor update on the inside - two bugs were fixed, most importantly the very finnicky #70. From the usability, PoV though, this is quite big.

The REPL now allows executing both statements and expressions. This means that there's no need for prefixing them with return - just 1+2 will work. It will also accept blocks with no results (such as function declarations) without unnecessary error messages.

In the same spirit, the main executable now uses a proper command line argument parsing, and includes a --file switch for loading files from disk for execution prior to going into the interactive mode.

Parsing numbers

08 Feb 11:05
Compare
Choose a tag to compare
Parsing numbers Pre-release
Pre-release

Again what seems like a minor addition represents months of work and that one long weekend. I've learned that parsing number is a really annoying and complex task.

It became a bit easier when I realized I can use the strength of Parsec to parse the contents of the literals (or just values) passed to tonumber. That didn't really help with the conversion process. This became much more reasonable once I realized that while Lua allows numbers in arbitrary bases, it only does that for integers; floating-point numbers are restricted to base 10.

This means I can delegate the base-10 parsing to existing, good implementations, and just do the base-n integers myself. I still don't particularly like this implementation, but since it lives in its own, isolated module, I can improve it whenever I feel the need for it.

One additional caveat is that I found a bug in the actual parser; it doesn't allow numbers starting or ending with a dot, which got an issue with an apt number #69. This will be solved separately.

Safe evalHead

27 Nov 12:45
Compare
Choose a tag to compare
Safe evalHead Pre-release
Pre-release

This is an incredibly minor change from the outside, but important from the code safety PoV. See #3 for details.

_G and fixed operators

03 Oct 19:02
Compare
Choose a tag to compare
Pre-release

This release adds _G (finally!), cleans up warnings and finally allows for idiomatic and and or use. The missing ~=, ^ and % are also introduced.

Bug-wise, the equality between two nils has been fixed (although it was more of a misunderstanding than a bug).

Issues: #29, #50, #52.

Refactored operators

23 Sep 09:18
f9901ca
Compare
Choose a tag to compare
Refactored operators Pre-release
Pre-release

Most of the work done is described in the #49 PR. No changes for end users, other than the fact that operators now don't reside in _G, but I doubt that any code ever built on that.

Length operator

26 Jul 12:54
Compare
Choose a tag to compare
Length operator Pre-release
Pre-release

This release also fixes precedence of all operators, sorting them according to the Lua spec/

Concat operator

19 Jul 13:08
Compare
Choose a tag to compare
Concat operator Pre-release
Pre-release

Added concatenation operator .. and __concat metamethod.