Permalink
Browse files

Swap :MANY-:SOME directives.

  • Loading branch information...
1 parent f00893b commit c3300dd3040bbfcff3a1be4f6a99912a0eb0beab Volkan YAZICI committed Jul 25, 2007
Showing with 6 additions and 6 deletions.
  1. +4 −4 README
  2. +2 −2 meta-sexp.lisp
View
8 README
@@ -38,8 +38,8 @@ atoms.lisp for DEFATOM examples.
Here is a tiny example:
(defrule integer? (&aux (sign 1) d (num 0)) ()
- (:? (:and "-" (:assign sign -1)))
- (:? "+")
+ (:? (:or (:and "-" (:assign sign -1))
+ "+"))
(:+ (:assign d (:type digit?))
(:assign num (+ (* num 10)
(- (char-code d) #.(char-code #\0)))))
@@ -145,11 +145,11 @@ SPACE? TAB? UPPER? WHITE-SPACE?
(:? FORM FORM ...)
May appear once. (Similar to `?' in regular expressions.)
-(:MANY FORM FORM ...)
+(:SOME FORM FORM ...)
(:* FORM FORM ...)
May appear none or more. (Similar to `*' in regular expressions.)
-(:SOME FORM FORM ...)
+(:MANY FORM FORM ...)
(:+ FORM FORM ...)
Must appear at least once. (Similar to `{1,}' in regular expressions.)
View
@@ -135,8 +135,8 @@
(:return `(signal 'parser-return :value (list ,@(cdr form))))
(:render `(,(cadr form) ,@(nconc (list ctx) (cddr form))))
((:? :optional) `(prog1 t ,(compile-expr `(:and ,@(cdr form)))))
- ((:* :many) `(not (do () ((not ,(compile-expr `(:and ,@(cdr form))))))))
- ((:+ :some) (compile-expr `(:and ,@(cdr form) (:* ,@(cdr form)))))
+ ((:* :some) `(not (do () ((not ,(compile-expr `(:and ,@(cdr form))))))))
+ ((:+ :many) (compile-expr `(:and ,@(cdr form) (:* ,@(cdr form)))))
(:type `(match-type ,ctx ,(cadr form)))
(:rule
(if (and (consp (cadr form))

0 comments on commit c3300dd

Please sign in to comment.