diff --git a/contrib/walker/example.lisp b/contrib/walker/example.lisp index c839ae1..93db367 100644 --- a/contrib/walker/example.lisp +++ b/contrib/walker/example.lisp @@ -255,3 +255,8 @@ :initially (print foo) :collect x :into foo :finally (print foo)) + +(let ((a 0) + b) + a + b) diff --git a/contrib/walker/tests/test-cases.lisp b/contrib/walker/tests/test-cases.lisp index cf94e19..46911d3 100644 --- a/contrib/walker/tests/test-cases.lisp +++ b/contrib/walker/tests/test-cases.lisp @@ -3755,3 +3755,27 @@ :DO (MICROS/WALKER::F MICROS/WALKER::N) (MICROS/WALKER::G MICROS/WALKER::N)) (2)) ((1 7) (1 6) (2))) +((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS + (LET ((MICROS/WALKER::A 0) MICROS/WALKER::B) + MICROS/WALKER::A + MICROS/WALKER::B) + (3)) + ((3) (1 1))) +((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS + (LET ((MICROS/WALKER::A 0) MICROS/WALKER::B) + MICROS/WALKER::A + MICROS/WALKER::B) + (2)) + ((2) (0 0 1))) +((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS + (LET ((MICROS/WALKER::A 0) MICROS/WALKER::B) + MICROS/WALKER::A + MICROS/WALKER::B) + (1 1)) + ((3) (1 1))) +((MICROS/WALKER:COLLECT-HIGHLIGHT-PATHS + (LET ((MICROS/WALKER::A 0) MICROS/WALKER::B) + MICROS/WALKER::A + MICROS/WALKER::B) + (0 0 1)) + ((2) (0 0 1))) diff --git a/contrib/walker/walker.lisp b/contrib/walker/walker.lisp index 0566ad5..5ce92a5 100644 --- a/contrib/walker/walker.lisp +++ b/contrib/walker/walker.lisp @@ -535,11 +535,14 @@ (walk-lambda-form walker form env path)) (defmethod walk-let-binding-form ((walker walker) binding-form env path) - (with-walker-bindings (var value) binding-form + (with-walker-bindings (var value) + (if (consp binding-form) + binding-form + (list binding-form nil)) (assert-type var 'variable-symbol) (let ((value (walk walker value env (cons 1 path)))) (make-instance 'let-binding-form - :path (cons 0 path) + :path (if (consp binding-form) (cons 0 path) path) :binding (make-instance 'lexical-variable-binding :name var :value value)