@@ -823,7 +823,7 @@ def _test_expr(tree):
823
823
# For this reason, we provide `with expand_testing_macros_first`, which
824
824
# in itself is a code-walking block macro, whose only purpose is to force
825
825
# `test[]` and its sisters to expand first.)
826
- sourcecode = unparse (tree )
826
+ sourcecode = unparse (tree , color = True , expander = dyn . _macro_expander )
827
827
828
828
envname = gensym ("e" ) # for injecting the captured value
829
829
@@ -866,7 +866,7 @@ def _record_value(envname, sourcecode, value):
866
866
def _inject_value_recorder (envname , tree ): # wrap tree with the the[] handler
867
867
recorder = q [h [_record_value ]] # TODO: stash hygienic value?
868
868
return q [a [recorder ](n [envname ],
869
- u [unparse (tree )],
869
+ u [unparse (tree , color = True , expander = dyn . _macro_expander )],
870
870
a [tree ])]
871
871
def _transform_important_subexpr (tree , envname ):
872
872
# The the[] mark mechanism is invoked outside-in, because for reporting,
@@ -915,7 +915,7 @@ def _test_expr_signals_or_raises(tree, syntaxname, asserter):
915
915
raise SyntaxError (f"Expected one of { syntaxname } [exctype, expr], { syntaxname } [exctype, expr, message]" ) # pragma: no cover
916
916
917
917
# Same remark about outside-in source code capture as in `_test_expr`.
918
- sourcecode = unparse (tree )
918
+ sourcecode = unparse (tree , color = True , expander = dyn . _macro_expander )
919
919
920
920
# Name our lambda to make the stack trace more understandable.
921
921
# For consistency, the name matches that used by `_test_expr`.
@@ -952,7 +952,7 @@ def _test_block(block_body, args):
952
952
raise SyntaxError ('Expected `with test:` or `with test[message]:`' ) # pragma: no cover
953
953
954
954
# Same remark about outside-in source code capture as in `_test_expr`.
955
- sourcecode = unparse (block_body )
955
+ sourcecode = unparse (block_body , color = True , expander = dyn . _macro_expander )
956
956
957
957
envname = gensym ("e" ) # for injecting the captured value
958
958
@@ -1024,7 +1024,7 @@ def _test_block_signals_or_raises(block_body, args, syntaxname, asserter):
1024
1024
raise SyntaxError (f'Expected `with { syntaxname } (exctype):` or `with { syntaxname } [exctype, message]:`' ) # pragma: no cover
1025
1025
1026
1026
# Same remark about outside-in source code capture as in `_test_expr`.
1027
- sourcecode = unparse (block_body )
1027
+ sourcecode = unparse (block_body , color = True , expander = dyn . _macro_expander )
1028
1028
1029
1029
testblock_function_name = gensym ("_test_block" )
1030
1030
thetest = q [(a [asserter ])(a [exctype ],
0 commit comments