mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +02:00
module/language/lua/parser.scm: Rename #:dots to #:varargs
This commit is contained in:
parent
becaec9a4e
commit
faa16f9989
6 changed files with 15 additions and 15 deletions
|
@ -282,7 +282,7 @@ of an identifier"
|
|||
(begin
|
||||
(read-char)
|
||||
(if (eqv? (peek-char) #\.)
|
||||
(begin (read-char) #:dots)
|
||||
(begin (read-char) #:varargs)
|
||||
#:concat))
|
||||
#\.)))
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ This is an org-mode todo list of stuff that needs to be done for Guile Lua.
|
|||
** TODO Use prompt and abort instead of throw and catch
|
||||
** TODO Standard library function: module
|
||||
** TODO Standard library function: table.sort
|
||||
** TODO Get the official test suite running
|
||||
** TODO Get the official Lua 5.1 test suite running
|
||||
|
||||
* Eh
|
||||
** TODO Standard library function: math.frexp
|
||||
Pending some additions to Guile's numeric tower.
|
||||
** TODO Better testing of standard library modules io, os
|
||||
** TODO Function environments (getfenv and setfenv)
|
||||
** TODO Parser should probably be rewritten
|
||||
|
||||
|
||||
* Differences
|
||||
Here are some difference in Guile Lua's behavior that should not cause
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
(define *special-tokens*
|
||||
'(#\. #\( #\) #\, #\- #\< #\; #\+ #\{ #\} #\[ #\] #\: #\#
|
||||
#:function #:end #:if #:return #:elseif #:then #:else #:true #:false
|
||||
#:nil #:== #:~= #:= #\> #:>= #:<= #:local #:dots #:break #:do #:in
|
||||
#:nil #:== #:~= #:= #\> #:>= #:<= #:local #:varargs #:break #:do #:in
|
||||
#:and #:or))
|
||||
|
||||
(define (token/type t)
|
||||
|
@ -466,7 +466,7 @@
|
|||
(values (reverse! parameters) #f))))
|
||||
((#\))
|
||||
(values (reverse! parameters) #f))
|
||||
((#:dots)
|
||||
((#:varargs)
|
||||
(advance!)
|
||||
(values (reverse! parameters) #t))
|
||||
(else
|
||||
|
@ -532,7 +532,7 @@
|
|||
;; table-literal
|
||||
((#\{) (table-literal))
|
||||
;; ...
|
||||
((#:dots)
|
||||
((#:varargs)
|
||||
(unless *vararg-function*
|
||||
(syntax-error src "cannot use '...' outside of a variable arguments function"))
|
||||
(advance! (make-ast-variable-arguments src)))
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
;;;; License as published by the Free Software Foundation; either
|
||||
;;;; version 3 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; This library is distributed in the hope that it will be useful,
|
||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;;; Lesser General Public License for more details.
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; You should have received a copy of the GNU Lesser General Public
|
||||
;;;; License along with this library; if not, write to the Free Software
|
||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
@ -37,7 +37,7 @@
|
|||
((test
|
||||
(syntax-rules ()
|
||||
((_ string expect)
|
||||
(pass-if (format "~S => ~S" string expect) (equal? (from-string string) expect)))
|
||||
(pass-if (format #f "~S => ~S" string expect) (equal? (from-string string) expect)))
|
||||
((_ string)
|
||||
(test string #t)))))
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;;;; lua-eval-2.test --- basic tests for builtin lua constructs, act III -*- mode: scheme -*-
|
||||
;;;; lua-eval-3.test --- basic tests for builtin lua constructs, act III -*- mode: scheme -*-
|
||||
;;;;
|
||||
;;;; Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
;;;;
|
||||
|
@ -45,5 +45,5 @@
|
|||
;;; y will equal 2 in case of extra eval
|
||||
(test "y = 0 function tmp() y = y + 1 return true end assert(tmp() or tmp()) return y == 1")
|
||||
;;; y will equal 4 in case of extra eval
|
||||
(test "y = 0 function tmp() y = y + 2 return false end; function tmp2() y = y + 1 return true end; print(tmp() and tmp2()) print(y) return y == 2")
|
||||
(test "y = 0 function void(x) end function tmp() y = y + 2 return false end; function tmp2() y = y + 1 return true end; void(tmp() and tmp2()) return y == 2")
|
||||
))
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
;;;; modify it under the terms of the GNU Lesser General Public
|
||||
;;;; License as published by the Free Software Foundation; either
|
||||
;;;; version 3 of the License, or (at your option) any later version.
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; This library is distributed in the hope that it will be useful,
|
||||
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;;; Lesser General Public License for more details.
|
||||
;;;;
|
||||
;;;;
|
||||
;;;; You should have received a copy of the GNU Lesser General Public
|
||||
;;;; License along with this library; if not, write to the Free Software
|
||||
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
@ -37,7 +37,7 @@
|
|||
((test
|
||||
(syntax-rules ()
|
||||
((_ string expect)
|
||||
(pass-if (format "~S => ~S" string expect) (equal? (from-string string) expect)))
|
||||
(pass-if (format #f "~S => ~S" string expect) (equal? (from-string string) expect)))
|
||||
((_ string)
|
||||
(test string #t)))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue