mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 17:20:29 +02:00
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.
This commit is contained in:
parent
4dbd29a9b8
commit
f78a1ccede
2 changed files with 14 additions and 9 deletions
|
@ -1,7 +1,8 @@
|
||||||
;;;; -*-scheme-*-
|
;;;; -*-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
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
;;;; License as published by the Free Software Foundation; either
|
;;;; License as published by the Free Software Foundation; either
|
||||||
|
@ -1206,10 +1207,13 @@
|
||||||
(syntax-case e ()
|
(syntax-case e ()
|
||||||
((_ e1 e2 ...) (expand-sequence #'(e1 e2 ...) r w s mod))
|
((_ e1 e2 ...) (expand-sequence #'(e1 e2 ...) r w s mod))
|
||||||
((_)
|
((_)
|
||||||
(begin
|
(if (include-deprecated-features)
|
||||||
(issue-deprecation-warning
|
(begin
|
||||||
"Sequences of zero expressions are deprecated. Use *unspecified*.")
|
(issue-deprecation-warning
|
||||||
(expand-void)))))
|
"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)
|
((local-syntax-form)
|
||||||
(expand-local-syntax value e r w s mod expand-sequence))
|
(expand-local-syntax value e r w s mod expand-sequence))
|
||||||
((eval-when-form)
|
((eval-when-form)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
;;;; syntax.test --- test suite for Guile's syntactic forms -*- scheme -*-
|
;;;; 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
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
;;;; License as published by the Free Software Foundation; either
|
;;;; License as published by the Free Software Foundation; either
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
((_ name pat exp)
|
((_ name pat exp)
|
||||||
(pass-if name
|
(pass-if name
|
||||||
(catch 'syntax-error
|
(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)
|
(lambda (k who what where form . maybe-subform)
|
||||||
(if (if (pair? pat)
|
(if (if (pair? pat)
|
||||||
(and (eq? who (car pat))
|
(and (eq? who (car pat))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue