mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-02 23:50:47 +02:00
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.
This commit is contained in:
parent
8c91ae59f9
commit
becaec9a4e
5 changed files with 124 additions and 44 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue