From 06385640e9016c9b235030739bf4e6c13e003a4a Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 20 Mar 2008 22:56:02 +0000 Subject: [PATCH] set svn:eol-style and minor formatting svn: r9034 --- collects/planet/planet-short-syntax.ss | 17 ++++------------ .../planet/private/short-syntax-helpers.ss | 20 +++++++++---------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/collects/planet/planet-short-syntax.ss b/collects/planet/planet-short-syntax.ss index bf39896091..6998a3a931 100644 --- a/collects/planet/planet-short-syntax.ss +++ b/collects/planet/planet-short-syntax.ss @@ -8,7 +8,7 @@ ;; SPEC ::= OWNER "/" PACKAGE VERSPEC PATHSPEC ;; VERSPEC ::= "" | "/" MAJ MINSPEC -;; MINSPEC ::= "" | "/" PMINSPEC +;; MINSPEC ::= "" | "/" PMINSPEC ;; PMINSPEC ::= MIN | ">=" MIN | "<=" MIN | MIN "-" MIN (define-require-syntax plan @@ -17,25 +17,16 @@ [(_ spec-sym) (symbol? (syntax->datum #'spec-sym)) (let ([str (symbol->string (syntax->datum #'spec-sym))]) - (define (yell msg) (λ (str) (raise-syntax-error #f (format msg str) #'spec-sym))) + (define (yell msg) (λ (str) (raise-syntax-error #f (format msg str) #'spec-sym))) (try-parsing str ([owner (get-next-slash #:on-error (yell "Illegal syntax; expected an owner, received ~e"))] [package (get-next-slash #:on-error (yell "Illegal syntax; expected a package, received ~e"))]) (λ (final-path) (let-values ([(pkg maj min) (parse-package package stx)]) - (quasisyntax/loc stx - (planet #,final-path (#,owner + (quasisyntax/loc stx + (planet #,final-path (#,owner #,pkg #,@(if maj (list maj) '()) #,@(if min (list min) '()))))))))] [(_ . any) #`(planet . any)]))) - - - - - - - - - \ No newline at end of file diff --git a/collects/planet/private/short-syntax-helpers.ss b/collects/planet/private/short-syntax-helpers.ss index 1cee0c2052..d12c969a65 100644 --- a/collects/planet/private/short-syntax-helpers.ss +++ b/collects/planet/private/short-syntax-helpers.ss @@ -67,13 +67,13 @@ [(not minstr) #f] [else (regexp-case minstr - [#rx"^>=([0-9]+)$" ((n) `(+ ,(string->number n)))] - [#rx"^<=([0-9]+)$" ((n) `(- ,(string->number n)))] - [#rx"^=([0-9]+)$" ((n) `(= ,(string->number n)))] - [#rx"^([0-9]+)-([0-9]+)$" ((m n) `(,(string->number m) ,(string->number n)))] - [#rx"^([0-9]+)$" ((n) (string->number n))] - [#rx"^$" (() #f)] ;; here for convenience reasons. a bit gross, i know - [else - (raise-syntax-error #f - (format "Illegal minor version specifier; expected <=n, >=n, =n, n-m, or n, where n, m are positive integers; received ~e" minstr) - stx)])])) \ No newline at end of file + [#rx"^>=([0-9]+)$" ((n) `(+ ,(string->number n)))] + [#rx"^<=([0-9]+)$" ((n) `(- ,(string->number n)))] + [#rx"^=([0-9]+)$" ((n) `(= ,(string->number n)))] + [#rx"^([0-9]+)-([0-9]+)$" ((m n) `(,(string->number m) ,(string->number n)))] + [#rx"^([0-9]+)$" ((n) (string->number n))] + [#rx"^$" (() #f)] ;; here for convenience reasons. a bit gross, i know + [else + (raise-syntax-error #f + (format "Illegal minor version specifier; expected <=n, >=n, =n, n-m, or n, where n, m are positive integers; received ~e" minstr) + stx)])]))