diff options
author | Andy Wingo <wingo@pobox.com> | 2010-12-10 11:28:00 +0100 |
---|---|---|
committer | Ian Price <ianprice90@googlemail.com> | 2013-09-09 17:01:23 +0100 |
commit | 32c58e2eddadff3939361124b0f81ab9c35c7a5a (patch) | |
tree | f4279537b5c9424d6ff524d0d6375fcfd3a12e48 /module/language/lua/common.scm | |
parent | a30c18c22a26be43f095e92c007142ae3fffc367 (diff) | |
download | guile-32c58e2eddadff3939361124b0f81ab9c35c7a5a.tar.gz |
syntax-error throws to syntax-error
* module/language/lua/common.scm (syntax-error): Throw to
'syntax-error.
Diffstat (limited to 'module/language/lua/common.scm')
-rw-r--r-- | module/language/lua/common.scm | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/module/language/lua/common.scm b/module/language/lua/common.scm index e68f1dda8..16b5af2c8 100644 --- a/module/language/lua/common.scm +++ b/module/language/lua/common.scm @@ -24,21 +24,11 @@ #:export (syntax-error or-eqv?)) -(define (syntax-error src string . arguments) - "Throw an error tagged with 'lua-syntax, and print detailed source -code information when available. STRING and ARGUMENTS are given to FORMAT." - (throw 'lua-syntax - (string-append - (if src - (format #f "~a@~a.~a" - (cdr (assq 'filename src)) - (cdr (assq 'line src)) - (if (assq 'column src) - (cdr (assq 'column src)) - "[no column available]")) - "[no source code information given]") - ": " - (apply format (cons string arguments))))) +(define (syntax-error src string . args) + "Throw an error tagged with 'syntax-error, and print detailed source +code information when available. STRING and ARGS are given to FORMAT." + (throw 'syntax-error #f (apply format #f string args) + src #f #f '())) ;; I was using CASE, but this is more succinct ;; (or-eqv? 1 #f 1) => (or (eqv? 1 #f) (eqv? 1 1)) |