diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-01-05 22:38:06 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-01-05 22:38:06 +0100 |
commit | f78a1ccede02ccad89d6c91a6b297f1f14a30907 (patch) | |
tree | 6f920184c8517fec4dcfa960a3b668d90281adde | |
parent | 4dbd29a9b8ea272fde54dcb0e8f47e23961f65d2 (diff) | |
download | guile-f78a1ccede02ccad89d6c91a6b297f1f14a30907.tar.gz |
Raise an error for (begin) when `--disable-deprecated'.
* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
Emit a syntax-violation error for empty sequences when
--disable-deprecated.
* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
message.
-rw-r--r-- | module/ice-9/psyntax.scm | 16 | ||||
-rw-r--r-- | test-suite/tests/syntax.test | 7 |
2 files changed, 14 insertions, 9 deletions
diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm index 4fec91719..22c51613d 100644 --- a/module/ice-9/psyntax.scm +++ b/module/ice-9/psyntax.scm @@ -1,7 +1,8 @@ ;;;; -*-scheme-*- ;;;; -;;;; Copyright (C) 2001, 2003, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. -;;;; +;;;; Copyright (C) 2001, 2003, 2006, 2009, 2010, 2011, +;;;; 2012 Free Software Foundation, Inc. +;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either @@ -1206,10 +1207,13 @@ (syntax-case e () ((_ e1 e2 ...) (expand-sequence #'(e1 e2 ...) r w s mod)) ((_) - (begin - (issue-deprecation-warning - "Sequences of zero expressions are deprecated. Use *unspecified*.") - (expand-void))))) + (if (include-deprecated-features) + (begin + (issue-deprecation-warning + "Sequences of zero expressions are deprecated. Use *unspecified*.") + (expand-void)) + (syntax-violation #f "sequence of zero expressions" + (source-wrap e w s mod)))))) ((local-syntax-form) (expand-local-syntax value e r w s mod expand-sequence)) ((eval-when-form) diff --git a/test-suite/tests/syntax.test b/test-suite/tests/syntax.test index ac9319dc5..0f8f2be45 100644 --- a/test-suite/tests/syntax.test +++ b/test-suite/tests/syntax.test @@ -1,7 +1,8 @@ ;;;; syntax.test --- test suite for Guile's syntactic forms -*- scheme -*- ;;;; -;;;; Copyright (C) 2001,2003,2004, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc. -;;;; +;;;; Copyright (C) 2001, 2003, 2004, 2005, 2006, 2009, 2010, +;;;; 2011, 2012 Free Software Foundation, Inc. +;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either @@ -88,7 +89,7 @@ ((_ name pat exp) (pass-if name (catch 'syntax-error - (lambda () exp (error "expected uri-error exception")) + (lambda () exp (error "expected syntax-error exception")) (lambda (k who what where form . maybe-subform) (if (if (pair? pat) (and (eq? who (car pat)) |