chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Strip syntax from identifiers in scrutiny outp


From: Evan Hanson
Subject: [Chicken-hackers] [PATCH] Strip syntax from identifiers in scrutiny output
Date: Wed, 6 Aug 2014 18:49:19 +1200

This resolves identifiers to their real (i.e. non-macro-aliased) names
in order to give cleaner scrutiny output messages.
---
 scrutinizer.scm         |    4 ++--
 tests/scrutiny.expected |   12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scrutinizer.scm b/scrutinizer.scm
index 49f72c6..a63c167 100644
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -274,7 +274,7 @@
     (define (fragment x)
       (let ((x (build-expression-tree x)))
        (let walk ((x x) (d 0))
-         (cond ((atom? x) x)
+         (cond ((atom? x) (##sys#strip-syntax x))
                ((>= d +fragment-max-depth+) '...)
                ((list? x)
                 (let* ((len (length x))
@@ -282,7 +282,7 @@
                                (append (take x +fragment-max-length+) '(...))
                                x)))
                   (map (cute walk <> (add1 d)) xs)))
-               (else x)))))
+               (else (##sys#strip-syntax x))))))
 
     (define (pp-fragment x)
       (string-chomp
diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected
index 5c072fc..f9df9f8 100644
--- a/tests/scrutiny.expected
+++ b/tests/scrutiny.expected
@@ -5,15 +5,15 @@ Note: in local procedure `c',
   expected value of type boolean in conditional but were given a value of type
   `number' which is always true:
 
-(if x3 1 2)
+(if x 1 2)
 
 Warning: in toplevel procedure `foo':
   branches in conditional expression differ in the number of results:
 
-(if x5 (values 1 2) (values 1 2 (+ (+ ...))))
+(if x (values 1 2) (values 1 2 (+ (+ ...))))
 
 Warning: at toplevel:
-  (scrutiny-tests.scm:15) in procedure call to `bar6', expected argument #2 of 
type `number', but was given an argument of type `symbol'
+  (scrutiny-tests.scm:15) in procedure call to `bar', expected argument #2 of 
type `number', but was given an argument of type `symbol'
 
 Warning: at toplevel:
   (scrutiny-tests.scm:17) in procedure call to `pp', expected 1 argument, but 
was given 0 arguments
@@ -25,7 +25,7 @@ Warning: at toplevel:
   expected in argument #1 of procedure call `(print (values))' a single 
result, but were given zero results
 
 Warning: at toplevel:
-  (scrutiny-tests.scm:23) in procedure call to `x7', expected a value of type 
`(procedure () *)', but was given a value of type `fixnum'
+  (scrutiny-tests.scm:23) in procedure call to `x', expected a value of type 
`(procedure () *)', but was given a value of type `fixnum'
 
 Warning: at toplevel:
   (scrutiny-tests.scm:25) in procedure call to `+', expected argument #1 of 
type `number', but was given an argument of type `symbol'
@@ -40,13 +40,13 @@ Warning: at toplevel:
   expected in `let' binding of `g8' a single result, but were given 2 results
 
 Warning: at toplevel:
-  in procedure call to `g89', expected a value of type `(procedure () *)', but 
was given a value of type `fixnum'
+  in procedure call to `g8', expected a value of type `(procedure () *)', but 
was given a value of type `fixnum'
 
 Note: in toplevel procedure `foo':
   expected value of type boolean in conditional but were given a value of type
   `(procedure bar30 () *)' which is always true:
 
-(if bar30 3 (##core#undefined))
+(if bar 3 (##core#undefined))
 
 Warning: in toplevel procedure `foo2':
   (scrutiny-tests.scm:54) in procedure call to `string-append', expected 
argument #1 of type `string', but was given an argument of type `number'
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]