From 97642c1cb6061d43b53d38013137a1cacb1873cb Mon Sep 17 00:00:00 2001 From: Carl Eastlund Date: Fri, 1 Jul 2011 15:32:34 -0400 Subject: [PATCH] Fixed syntax/parse bug: Syntax classes with keyword arguments were unintentionally requiring all arguments at an application site to be in alphabetical order. Added a test for this fix. --- collects/syntax/parse/private/kws.rkt | 4 ++-- collects/tests/stxparse/stxclass.rkt | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/collects/syntax/parse/private/kws.rkt b/collects/syntax/parse/private/kws.rkt index c9f94b3c07..00e1ebb4fd 100644 --- a/collects/syntax/parse/private/kws.rkt +++ b/collects/syntax/parse/private/kws.rkt @@ -46,7 +46,7 @@ An Arity is (arity-maxpos arity) (arity-minkws arity) (arity-maxkws arity) - pos-count keywords)]) + pos-count (sort keywords keyword (syntax-e #'b0)) (void)]) + +(define-syntax-class (Nat-Between #:lo lo #:hi hi) + #:description (format "~s <= Nat <= ~s" lo hi) + (pattern x:nat #:when (<= lo (syntax-e #'x) hi))) +(syntax-parse #'5 + [(~var _ (Nat-Between #:lo 0 #:hi 10)) (void)])