Fix correlation being broken with macros
Before, a program like (when true 4) would input sixty-odd lines of
space when compiled with --correlate. This is because the invocation
of the when macro caused the AST to include a node with a line number
of the code *in macro.fnl*. The compiler already checked for the file
name of the syntax tree and the currently-compiled file being equal,
but both checks were broken and always returned nil (without an error),
so the correlation always happened.
This patch might break something, since it messes with some code that
has been silently failing for a bit.
Bump version number up to 0.9.2-dev
A couple release hiccups.
Only emit disambiguating semicolon when it's needed.
Tragically, Lua is not a lisp.
As seen in https://todo.sr.ht/~technomancy/fennel/52 the semicolon we
used to disambiguate grouping vs function calls is allowed anywhere in
PUC Lua, but not in LuaJIT. LuaJIT refuses to allow the semicolon if
it's not actually separating statements, so we check to make sure that
the code being emitted is not the first thing in the chunk.
Add uploadrock to makefile.
Bump to 0.9.0-dev version.
Omit the bitop tests entirely under 5.1 and 5.2.
Add tests for bitops; tweak docstrings a bit.
Support emitting both foo & bar and bit.band(foo, bar).
Add support for fennel.macro-searchers.
We now have a fennel.macro-searchers table which functions as a
compile-time equivalent to the package.searchers table; anyone can
insert their own searcher functions to change how macros can be found.
The main thing I don't like about this is that it exposes our little
internal trick of passing :env :_COMPILER in the options table to load
things in compiler scope. We have supported this for the environment
for internal reasons for a while, but now we both expand it (to also
affect :scope) and document it as part of the interface, in order to
simplify the implementation of the default macro searcher function.
I don't love that trick; it was originally added in order to allow us
to load plugins in compiler scope without reaching into the guts of
the compiler module, but it feels like a bit of a hack.
We could maybe make it cleaner by exposing make-compiler-scope and
make-compiler-env as part of the public API, but I'm not sure it's
necessary. If this shorthand gets the same job done as adding two more
functions to our already-big API, maybe that's fine. Or we can add the
shorthand now and introduce the other functions later if we determine
they are useful.
Emit "local foo" instead of "local foo = nil"
Factor out named-fn vs anonymous-fn.
But we can't actually treat an anonymous fn differently yet.
Support &as in pattern matches.
Backport long arglist bugfix to bootstrap compiler.
Originally fixed in 0.6.0 in 1fff49891b5fc37e73b49ba0cab4c6a0cd57d0fd
Use semicolon instead of do/end as paren disambiguation.
It's just clearer what it's there for, and it shouldn't give luacheck warnings.
Fix macro stack trace test for 5.1.
Next version will be 0.9.0 not 0.8.2
Include stack trace when macroexpansion fails.
Fix a bug where a literal true in an if condition would emit invalid Lua