Action-generating function in bootstrap code fixed.
authorUtz-Uwe Haus <lisp@uuhaus.de>
Fri, 3 Oct 2008 21:46:02 +0000 (3 23:46 +0200)
committerUtz-Uwe Haus <lisp@uuhaus.de>
Fri, 3 Oct 2008 21:46:02 +0000 (3 23:46 +0200)
Now generates action code correctly, but does not generate action names
containing context info anymore.

pegparser-boot.lisp
pegutils.lisp

index 5bfa3a2..eade63e 100644 (file)
@@ -89,7 +89,7 @@
                                   (opossum::SEQ (|parse_bracketed-rule|)
                                                 (LIST ':action NIL
                                                       '|metapeg_action333|))
-                                  (opossum::MATCH-STRING "!.")
+                                  
                                   (opossum::SEQ (opossum::MATCH-STRING "!")
                                                 (|parse_expr|)
                                                 (LIST ':action NIL
                       (opossum::fix-escape-sequences
                        (mapcar #'second action-sans-{))
                       'string))
-        (ctx (fourth (fourth data)))
-        (action-name (opossum::make-action-name :ctx ctx)))
+        (action-name (opossum::make-action-name)))
     (opossum::store-action opossum:*context*
                           `(,action-name ,action-code))
     `(list ':action nil ',action-name)))
index 4171af8..e9a9382 100644 (file)
                           (car (action-counter *context*))
                           (start-index ctx)
                           (end-index ctx))
-                  (format nil "opossum-action-~D-~D~D"
+                  (format nil "opossum-action-~D"
                           (car (action-counter *context*)))) ))
     (intern aname (dst-package *context*))))
 
@@ -481,7 +481,7 @@ DST-PACKAGE will contain the 3 functions PARSE-STRING, PARSE-FILE and PARSE-STRE
                :when sym ;; the final action is named NIL because we push a
                ;; NIL ahead of us in store-actions
                :do (when *trace* (format *trace-output* "Inserting defun for ~A~%" sym))
-               :and :do (format s "~%(defun ~S (data)~% (declare (ignorable data))~% ~A)~%"
+               :and :do (format s "~%(defun ~S (data)~% (declare (ignorable data) (type list data))~% ~A)~%"
                                 sym (cleanup-action-code code))))))))
 
 (defun generate-parser-package (grammarfile &key (dst-package (make-package (gensym "opossum-parser-")))