effects: make :type print as :type instead of ``_: type``
parent
8ae6e8e23d
commit
839a5a22ec
|
@ -56,5 +56,8 @@ IN: effects.tests
|
||||||
{ ( x -- ) } [ ( a b -- ) curry-effect ] unit-test
|
{ ( x -- ) } [ ( a b -- ) curry-effect ] unit-test
|
||||||
|
|
||||||
! test unnamed types
|
! test unnamed types
|
||||||
{ ( _: fixnum -- _: float ) } [ ( :fixnum -- :float ) ] unit-test
|
{ ( :fixnum -- :float ) } [ ( :fixnum -- :float ) ] unit-test
|
||||||
{ ( _: union{ fixnum bignum } -- ) } [ ( :union{ fixnum bignum } -- ) ] unit-test
|
{ ( :union{ fixnum bignum } -- ) } [ ( :union{ fixnum bignum } -- ) ] unit-test
|
||||||
|
|
||||||
|
{ "( :( :integer -- :integer ) :float -- :bignum )" }
|
||||||
|
[ ( :( :integer -- :integer ) :float -- :bignum ) unparse ] unit-test
|
||||||
|
|
|
@ -54,7 +54,12 @@ M: string effect>string ;
|
||||||
M: object effect>string drop "object" ;
|
M: object effect>string drop "object" ;
|
||||||
M: word effect>string name>> ;
|
M: word effect>string name>> ;
|
||||||
M: integer effect>string number>string ;
|
M: integer effect>string number>string ;
|
||||||
M: pair effect>string first2-unsafe [ effect>string ] bi@ ": " glue ;
|
M: pair effect>string
|
||||||
|
first2-unsafe over [
|
||||||
|
[ effect>string ] bi@ ": " glue
|
||||||
|
] [
|
||||||
|
nip effect>string ":" prepend
|
||||||
|
] if ;
|
||||||
|
|
||||||
: stack-picture ( seq -- string )
|
: stack-picture ( seq -- string )
|
||||||
[ [ effect>string % CHAR: \s , ] each ] "" make ;
|
[ [ effect>string % CHAR: \s , ] each ] "" make ;
|
||||||
|
|
|
@ -35,7 +35,7 @@ ERROR: bad-standalone-effect obj ;
|
||||||
dup parsing-word? [
|
dup parsing-word? [
|
||||||
?execute-parsing dup length 1 =
|
?execute-parsing dup length 1 =
|
||||||
[ first ] [ bad-standalone-effect ] if
|
[ first ] [ bad-standalone-effect ] if
|
||||||
] when "_" swap 2array ;
|
] when f swap 2array ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: parse-effect-token ( first? var end -- var more? )
|
: parse-effect-token ( first? var end -- var more? )
|
||||||
|
|
Loading…
Reference in New Issue