~remexre/nr-langutil

497866c2df054f404747f8dd4e1484983206bbc5 — Nathan Ringo 1 year, 1 month ago b23566c
...
2 files changed, 6 insertions(+), 10 deletions(-)

M parser/parse-clauses.lisp
M parser/runtime.lisp
M parser/parse-clauses.lisp => parser/parse-clauses.lisp +5 -9
@@ 92,15 92,11 @@
      (for ignored = nil)
      (iter
        (for arg in args)
        (with-gensyms (name)
          (push name arg-list)
          (if (consp arg)
              (let ((var (first  arg))
                    (ty  (second arg)))
                (if (keywordp ty)
                    (push `(,var (lexeme/string ,name)) bindings)
                    (push `(,var ,name)                 bindings)))
              (push name ignored))))
        (for name = (gensym (symbol-name (if (consp arg) (first arg) name))))
        (push name arg-list)
        (if (consp arg)
            (push (list (first arg) name) bindings)
            (push name ignored)))
      (collect
        (cons (- (gethash nt nonterminals) (hash-table-count terminals))
              (cons (length args)

M parser/runtime.lisp => parser/runtime.lisp +1 -1
@@ 123,7 123,7 @@
             (multiple-value-bind (args new-value-stack) (pop-n arg-count value-stack)
               (setf value-stack new-value-stack)
               (let ((*location* (location-from-list args (location lexeme))))
                 (push (apply func args) value-stack))
                 (push (apply func (dbg args)) value-stack))
               (setf state-stack (nthcdr arg-count state-stack))
               (setf state-stack (cons (aref goto-table (car state-stack) goto-idx) state-stack))))))
        (t