puredartlua 1.0.14
puredartlua: ^1.0.14 copied to clipboard
Lua 5.5 interpreter and autodoc tool written in pure Dart.
1.0.14 #
- Functions can return multiple arguments but any field access operation acts on the first argument only.
- Added semicolon support.
- Updated missing features section in the readme.
- Discovered
breakkeyword logic was not added yet! Added. - Weak checks for
,or;tokens while parsing table pairs now strict. Added sanity check test for this. - Function calls with one argument of either string or table literal can omit parens.
- Added string-to-number coercion under addition. Added relevant test
coercion.lua. popScope()->restoreScope(next).- With closures I cannot pop the scope back to the parent b/c the parent for a closure is generally not in the next branch of execution after the closure finishes. Therefore I had to restore the scope everywhere
popScope()was used. It's a bit uglier but it was necessary. Added testcurrying.luawhich tests closures and the new one-argument syntax sugar.
- With closures I cannot pop the scope back to the parent b/c the parent for a closure is generally not in the next branch of execution after the closure finishes. Therefore I had to restore the scope everywhere
- Slight rewrite to function calls to allow forwarded objects to be passed in by the name of the first argument.
- Previously forward function calls (via
:) always wrote to aselfvariable in the new scope. This was wrong to do. - Added
functions.luatest to catch this.
- Previously forward function calls (via
- Added
__callmetamethod support. - Added
__newindexmetamethod support.- This effort required a change in parsing so that assignment exprs are not math exprs. And the assignment visitor explicitly checks to see if the lhs is a table index operation.
- Added
__indexmetamethod support. - Added
rawset(t, k, v)andrawget(t, k). - Fixed long-standing out-of-range error calling functions having less arguments than their definition. Unsupplied args are now nil. This is now similar to multivariable declarations which is correct.
run,runner,parse, andparseFilenow take optionalRunnerErrorsCallback? onErrorto handle errors from trace.- So that it does not pollute other projects.
- Assignment expressions can no longer be used as values (value is the result of lhs). This was illegal lua.
- Rename
AssignExpr->AssignStmt.AssignMultiExpr->AssignMultiStmt. - Added first ever AutoDoc example.
1.0.13 #
- Forgot to drop comments after the lexing phase. This caused runtime problems with the repl.
- Ensured by hand that all the scopes were popped on exceptions. Some cases were missed in ForIterLoop and other loops.
- Fixed
repeat... untilloop condition. LuaObject.valuesetter now copies the function definition information so this doesn't have to be repeated in other parts of the codebase.- As a consequence, value must be set first and then the function definition is copied in the function special constructor.
- Moved passing tests into
/passto prepare for tests that are expected to fail in the future.
1.0.12 #
- Fixed
mathfunction errors causing unhelpful errors becausecontext.idis no longer storing current function call information. - Fixed
math.minandmath.maxnot behaving correctly.
1.0.11 #
- Fixed REPL lower-casing all user input. This prevented global vars from being read.
LuaObject.toString()maps totablefor table objects. Before it was printing their name if they had an id.
1.0.10 #
- Meta table support added.
setmetatable(t, mt)andgetmetatable(t)work as expected.- Metamethods added to runtime.
- Includes new tests under
/test/assets/metamethods.
- Includes new tests under
- Multivalue arg unpacking behaves as expected.
- Return values support multiple values correctly.
- Variadic args support multiple values correctly.
- Global upvalues now use
_ENVand includes legacy_Gwhich points to_ENV. CoroutineAPI added to std library.- Note that coroutines do not work at this time.
- Entire
mathlibrary completed. - Bitwise operations added.
- All functions rethrow now on exceptions unless
callLuaFunctionis used with an exception handler. pcall()implementation follows from the new function exception behavior.- Update to
README.mdincludes a get starting section and lists the remaining unfinished features.
1.0.9 #
tokenis now a field on all grammar nodes viaStmtbase class.- Started but did not complete coroutines.
- Had to push this premature version because an existing project was expecting some of these changes! Whoops.
1.0.8 #
tokenfield on AST nodes is mutable (non final) to allow in-place transformations for upgrade tools.- Added
parse(String path)to construct AST forrunner. - Added
-vflag to cli to dump DOT files as HTML for the input lua script.
1.0.7 #
- The
#operator bound to the wrong level (binary expressions). Made them bind to memory types (literals, function calls, etc). My small tests seems to fix this. - Misnamed
include()->require(). - Misnamed
IncludeCallback->LuaRequireCallback. - Added
LuaObject.unpack()as a shortcut for lua behavior: return functions for tables with a single field are unpacked.
1.0.6 #
LuaObject.writeFieldsFromtakes a list of lua objects whose ID's will become the field keys too.- constructor
LuaObject.tableFromadded under similar rationale. - singular writer
LuaObject.writeFieldFromadded under similar rationale. - When invoking a function, the new scope no longer retains context of itself (the caller)
- b/c this created incorrect behavior when resolving parameters during AST visit.
- b/c if using
self, already provides the caller. - b/c now has correct outcome in other projects using this lib after removal.
1.0.5 #
- Hotfixes
- Autodoc crash when evaluating
LuaObjectNoSemanticstype. - Fixed table test.
- Note to self: tests should be modernized in the next update.
- Autodoc crash when evaluating
1.0.4 #
notkeyword was resolving when something was truthy instead of the opposite.- Moved
onWriteandonReadcallbacks to the end of the operation so that programmers can react to changed values and know those values. ReturnStmtCallStackUnwindandReturnStmtDoNotUnwindadded as mixins. These are required to use to form a complete base class forBaseRuntime.- The former is expected lua runtime behavior. The latter is for cases where users want to perform static analysis.
callLuaFunction(luaObject, args)helper utility function added toBaseRuntime.- Pushes and pop the scope, handles exceptions, and declares variables in-order of the function definition.
toLua(id)now creates a new lua object with the nameidin all cases. This is convenient for function callsmakeLuaRef()is a method that returns the exact lua object pointer without making a copy object.- If the underlying object is not a
LuaObject, the null is returned.
- If the underlying object is not a
- Grammar fix: underlining -> underlying
1.0.3 #
-
Added new token
TokenType.kSpreadfor varargs. -
Added support for variadic arguments.
-
Fixed for-loop evaluation to allow variables.
-
If the end-user does not drop comments, the parser will now skip over them as expected.
-
Took out hacks to promote failed assigned values to variables.
- This may come back to break some things...
-
Corected equality checks.
-
Only numbers and strings can be concatenated.
-
Wrote a bunch of test scripts to begin building a test suite.
-
Changed
showDateTimetodateTimeFormatwhich is aString?type.- When this is null, it does not show the date.
- When this is non-null, uses intl package
DateFormatclass.
-
Added
showSidebarIndexwhich now paritions the page so that the index is in a sticky sidebar. -
Title, version, and datetime now have css classes
version-title,version-number,version-datetimerespectively.
1.0.2 #
- Fixed variables without parent objects (non-fields + globals) not generating headers.
- Added optional
jsandcssparameter to the autodoc.- The autodoc has its own theme defaults but can be replaced with these parameters.
- Added lua classes to the generated headers in the autodoc output.
- For variables
lua-field. - For functions
lua-func. - For tables
lua-table.
- For variables
- Fixed some bad HTML output (tag mismatches or lack thereof).
1.0.1 #
- Added floating return button in the output autodoc to return readers to the top of the index.
- Added optional version subtext to the autodoc.
- Added optional boolean to show or hide timestamp generation.
1.0.0 #
- Initial version.