summaryrefslogtreecommitdiff
path: root/module/language/lua
AgeCommit message (Collapse)AuthorFilesLines
2013-09-09Fix code generated for `while'.Ian Price1-2/+2
* module/language/lua/compile-tree-il.scm (while-loop->tree-il): Generate `letrec' instead of `let'. Generate valid `lambda' expression.
2013-09-09Add missing `make-sequence' procedure.Ian Price1-0/+5
* module/language/lua/compile-tree-il.scm (make-sequence): New procedure.
2013-09-09Use `make-application' instead of removed `make-call'.Ian Price1-51/+51
* module/language/lua/compile-tree-il.scm: Rename.
2013-09-09Compile Lua's ... form.Ian Price2-7/+19
* module/language/lua/compile-tree-il.scm (compile): Add clause for ast-variable-arguments. * module/language/lua/parser.scm (define-ast, make-parser): Add vararg-gensym field to functions, gensym field to variable-arguments. Propagate *vararg-gensym* from functions to variable-arguments. * test-suite/tests/lua-eval-2.test ("lua-eval"): Check for #nil
2013-09-09Add some documentation. Function calls now properly handle multiplePhil4-31/+87
values resulting from a function call as the last argument. doc/ref/api-languages.texi: Add a small blurb about Lua. module/language/lua/compile-tree-il.scm: Function calls now properly handle multiple values resulting from a function call as the last argument.
2013-09-09module/language/lua/parser.scm: Rename #:dots to #:varargsPhil3-7/+7
2013-09-09Fix and/or double evaluation. Add math.modf, math.fmod.Phil4-43/+74
* module/language/lua/compile-tree-il.scm: Fix and/or double evaluation. * module/language/lua/notes.org: Add file describing known issues. * module/language/lua/parser.scm: (token-type): Recognize and/or. * module/language/lua/standard/math.scm: Add modf, fmod implementations. * test-suite/tests/lua-eval-3.test: Add another test file for basic language features.
2013-09-09lua code returning via normal pathAndy Wingo1-2/+2
* module/language/lua/compile-tree-il.scm (compile): Get more lua code returning via the normal path.
2013-09-09lua/runtime tweaksAndy Wingo1-113/+140
* module/language/lua/runtime.scm: Various indentation and idiom tweaks.
2013-09-09lua/lexer tweaksAndy Wingo2-74/+68
* module/language/lua/lexer.scm: Some tweaks and reindentations. Remove the define/init lexer interface; I don't like separating declaration and initialization. * module/language/lua/parser.scm: * test-suite/tests/lua-lexer.test: Adapt to lexer interface change.
2013-09-09lua/compile-tree-il tweaksAndy Wingo1-121/+156
* module/language/lua/compile-tree-il.scm: Reflow a bit, and a number of small rewrites. Added some FIXMEs.
2013-09-09remove true? and false?; lua's truthiness and falsehood is guile's.Andy Wingo2-26/+8
* module/language/lua/runtime.scm (true?, false?): Remove, now that #nil is false. * module/language/lua/compile-tree-il.scm: Don't emit calls to true? or false?.
2013-09-09lua/parser tweaksAndy Wingo1-472/+436
* module/language/lua/parser.scm (define-record, define-ast): Simplify these macros. (make-parser): A number of small idiomatic changes.
2013-09-09lua/common cleanupAndy Wingo5-19/+8
* module/language/lua/common.scm: Remove `or-eqv?'. Make a bit more idiomatic. * module/language/lua/compile-tree-il.scm: * module/language/lua/lexer.scm: * module/language/lua/parser.scm: * module/language/lua/runtime.scm: Replace or-eqv? instances with memq or memv.
2013-09-09syntax-error throws to syntax-errorAndy Wingo1-15/+5
* module/language/lua/common.scm (syntax-error): Throw to 'syntax-error.
2013-09-09add lua language implementationNo Itisnt10-0/+2846
What is missing: + Functions: module, getfenv, setfenv, math.modf, table.sort + Parser: needs to be more flexible + Compiler: needs more extensive work to properly handle all possible cases of variable arguments, multiple returns, and loops + Language: Variable arguments and unpacking of multiple returns. (For example we need to be able to handle something as complex as print(unpack({...})), which is easy with Lua's explicit stack but will require lots of tree-il gymnastics, or perhaps modifications to better allow different calling conventions. (For instance -- how would we support Python or Ruby, where keyword arguments are gathered into a hashtable and passed as a single argument?) What is there: A fair shot at supporting Lua 5.1, not quite a drop-in replacement, but not far from that goal either.