set svn:eol-style and minor formatting

svn: r9034
This commit is contained in:
Eli Barzilay 2008-03-20 22:56:02 +00:00
parent 8071791db2
commit 06385640e9
2 changed files with 14 additions and 23 deletions

View File

@ -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)])))

View File

@ -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)])]))
[#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)])]))