Skip to content

Commit

Permalink
fix defun form and add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
cxxxr committed Nov 6, 2023
1 parent 93ff8e0 commit 6ff305f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion contrib/walker/tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,13 @@
(BLOCK FOO (RETURN-FROM FOO 20) (RETURN-FROM FOO 30))
(RETURN-FROM FOO 40))
(1))
((1 4) (1 2) (1)))))
((1 4) (1 2) (1)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (6)) ((6) (4) (1 2)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (5)) ((5) (3) (0 2)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (4)) ((6) (4) (1 2)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (3)) ((5) (3) (0 2)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (1 2)) ((6) (4) (1 2)))
((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS (DEFUN F (X Y) X Y X Y) (0 2)) ((5) (3) (0 2)))))

(deftest random
(loop :for (act-form expected) :in *test-cases*
Expand Down
3 changes: 1 addition & 2 deletions contrib/walker/walker.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
;; ast
(defclass ast (<printable>)
((path :initarg :path
:initform (error "Missing :path")
:initform nil
:reader ast-path)))

(defgeneric ast-equal (ast1 ast2))
Expand Down Expand Up @@ -752,7 +752,6 @@
:name name
:lambda-list lambda-list
:body (make-instance 'implict-progn-form
:path (cons 3 path)
:forms (walk-forms walker body env path 3))
:path (cons 0 path)))))

Expand Down

0 comments on commit 6ff305f

Please sign in to comment.