summaryrefslogtreecommitdiff
path: root/module/language/lua/parser.scm
diff options
context:
space:
mode:
authorPhil <theseaisinhere+git@gmail.com>2011-04-21 18:05:48 -0500
committerIan Price <ianprice90@googlemail.com>2013-09-09 17:01:24 +0100
commitbecaec9a4e7042a98c2dfa5fd3af9d7c30f71f44 (patch)
tree94f4ed7ffe76db22904f085ea9c3717e43875962 /module/language/lua/parser.scm
parent8c91ae59f97200208962d845dbe972ad7c3cda3c (diff)
downloadguile-becaec9a4e7042a98c2dfa5fd3af9d7c30f71f44.tar.gz
Fix and/or double evaluation. Add math.modf, math.fmod.
* 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.
Diffstat (limited to 'module/language/lua/parser.scm')
-rw-r--r--module/language/lua/parser.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/language/lua/parser.scm b/module/language/lua/parser.scm
index 1a04f89da..52cf5a381 100644
--- a/module/language/lua/parser.scm
+++ b/module/language/lua/parser.scm
@@ -125,7 +125,8 @@
(define *special-tokens*
'(#\. #\( #\) #\, #\- #\< #\; #\+ #\{ #\} #\[ #\] #\: #\#
#:function #:end #:if #:return #:elseif #:then #:else #:true #:false
- #:nil #:== #:~= #:= #\> #:>= #:<= #:local #:dots #:break #:do #:in))
+ #:nil #:== #:~= #:= #\> #:>= #:<= #:local #:dots #:break #:do #:in
+ #:and #:or))
(define (token/type t)
(cond
@@ -252,11 +253,11 @@
"Given a variable's NAME, look up its binding."
(and e (or (assq-ref (environment-bindings e) name)
(environment-lookup-aux name (environment-parent e)))))
-
+
(define (environment-lookup-gensym name)
"Given a variable's NAME, look up its gensym"
(and=> (environment-lookup-aux name) binding-gensym))
-
+
(define (environment-lookup-type name)
"Given a variable's NAME, look up its global"
(and=> (environment-lookup-aux name) binding-type))
@@ -675,7 +676,7 @@
*void-literal*)))))))
(enforce-next! #:end)
x))))
-
+
;; repeat-statement -> REPEAT chunk UNTIL expression
(define (repeat-statement)
(let ((src (get-source-info)))