Fix locals prettyprinting

db4
Slava Pestov 2008-03-12 02:36:31 -05:00
parent 120c9cacb7
commit 68ff467f6a
2 changed files with 20 additions and 2 deletions

18
extra/locals/locals-tests.factor Normal file → Executable file
View File

@ -116,6 +116,12 @@ write-test-2 "q" set
[ ] [ 5 write-test-4 drop ] unit-test
! Not really a write test; just enforcing consistency
:: write-test-5 ( x -- y )
[wlet | fun! [ x + ] | 5 fun! ] ;
[ 9 ] [ 4 write-test-5 ] unit-test
SYMBOL: a
:: use-test ( a b c -- a b c )
@ -160,3 +166,15 @@ M:: string lambda-generic ( a b -- c ) a b lambda-generic-2 ;
[ ] [ \ lambda-generic-2 see ] unit-test
[ ] [ \ lambda-generic see ] unit-test
[ "[let | a! [ ] | ]" ] [
[let | a! [ ] | ] unparse
] unit-test
[ "[wlet | a! [ ] | ]" ] [
[wlet | a! [ ] | ] unparse
] unit-test
[ "[| a! | ]" ] [
[| a! | ] unparse
] unit-test

View File

@ -317,7 +317,7 @@ M: lambda pprint*
\ | pprint-word
t <inset
<block
values [ <block >r pprint-word r> pprint* block> ] 2each
values [ <block >r pprint-var r> pprint* block> ] 2each
block>
\ | pprint-word
<block pprint-elements block>
@ -329,7 +329,7 @@ M: let pprint*
\ ] pprint-word ;
M: wlet pprint*
\ [let pprint-word
\ [wlet pprint-word
{ wlet-body wlet-vars wlet-bindings } get-slots pprint-let
\ ] pprint-word ;