Commits

Anonymous committed 0030e2e

Merge bugfix patch from main--0.1
Keywords: bugfix, merge

Patches applied:

* lispnik@gmail.com--2006-fucc/fucc--main--0.1--versionfix-4
Do not call EXPAND-RULES on rules that generated expanded

  • Participants
  • Parent commits dcafa77

Comments (0)

Files changed (1)

File generator/fg-grammar.lisp

   (mapcan
    #'(lambda (rule)
        (let ((more-rules ())
-             (rule2 (generate-action rule))
              (transforms nil))
          (let ((new-rhs
-                (loop :for form :in (cddr rule2)
+                (loop :for form :in (cddr rule)
                       :for pos :from 0
                       :if (consp form)
                       :collect
                       (multiple-value-bind (new-nterm new-rules transform)
-                          (parse-complex-form form rule2 pos)
+                          (parse-complex-form form rule pos)
                         (push transform transforms)
                         (setf more-rules
                               (nconc more-rules
                       :end)))
            (setf transforms (nreverse transforms))
            (list*
-            `(,(first rule2)
+            `(,(first rule)
               ,(if (some #'identity transforms)
-                   (apply-argument-transforms transforms (second rule2))
-                   (second rule2))
+                   (apply-argument-transforms transforms (second rule))
+                   (second rule))
               ,@new-rhs)
             more-rules))))
    rules))
                             initial))))
   (with-new-grammar-environment
     (multiple-value-bind (terms first-nterm-id)  (init-env terminals)
-      (let* ((proc-rules (mapcar #'process-rule (expand-rules rules)))
+      (let* ((proc-rules (mapcar #'process-rule
+                                 (expand-rules
+                                  (mapcar #'generate-action rules))))
              (nterms (sort (loop :for nterm
                                  :being :each :hash-value :of *grammar-environment*
                                  :when (not (term-p nterm))