modern: Fix all the syntax errors.

Support ``{abc}foo{`` as a token name

Bug to fix:
! should error
[[M: error-class see-class*
    <colon \ ERROR: pprint-word
    {
        [ pprint-word ]
        [ superclass. ]
        [ <block "slots" word-prop [ name>> pprint-slot-name ] each block> pprint-semi ]
        [ tuple-declarations. ]
    } cleave
    block> ;]] string>literals >strings
modern-harvey3
Doug Coleman 2019-10-20 14:17:09 -05:00
parent 980840d360
commit c4cd8991be
71 changed files with 191 additions and 184 deletions

View File

@ -66,7 +66,7 @@ M: word <c-direct-array>
M: pointer <c-direct-array>
drop void* <c-direct-array> ;
SYNTAX: \c-array{ \ } [ unclip >c-array ] parse-literal ;
SYNTAX: \c-array{ \ \} [ unclip >c-array ] parse-literal ;
SYNTAX: c-array@
scan-object [ scan-object scan-object ] dip

View File

@ -37,7 +37,7 @@ ERROR: bad-array-type ;
: scan-c-type ( -- c-type )
scan-token {
{ [ dup "{" = ] [ drop \ } parse-until >array ] }
{ [ dup "{" = ] [ drop \ \} parse-until >array ] }
{ [ dup "pointer:" = ] [ drop scan-c-type <pointer> ] }
[ parse-c-type ]
} cond ;

View File

@ -11,12 +11,12 @@ M: alien pprint*
{
{ [ dup expired? ] [ drop \ BAD-ALIEN pprint-word ] }
{ [ dup pinned-c-ptr? not ] [ drop "( displaced alien )" text ] }
[ \ alien: [ alien-address >hex text ] pprint-prefix ]
[ \ \alien: [ alien-address >hex text ] pprint-prefix ]
} cond ;
M: dll pprint* dll-path dup "DLL\" " "\"" pprint-string ;
M: c-type-word definer drop \ C-TYPE: f ;
M: c-type-word definer drop \ \C-TYPE: f ;
M: c-type-word definition drop f ;
M: c-type-word declarations. drop ;
@ -37,9 +37,9 @@ PRIVATE>
[ record-c-type ] [ c-type-string ] [ ] tri present-text ;
M: pointer pprint*
<flow \ pointer: pprint-word to>> pprint* block> ;
<flow \ \pointer: pprint-word to>> pprint* block> ;
M: typedef-word definer drop \ TYPEDEF: f ;
M: typedef-word definer drop \ \TYPEDEF: f ;
M: typedef-word synopsis*
{
@ -60,7 +60,7 @@ M: typedef-word synopsis*
] if-empty ;
: pprint-library ( library -- )
[ \ LIBRARY: [ text ] pprint-prefix ] when* ;
[ \ \LIBRARY: [ text ] pprint-prefix ] when* ;
: pprint-function ( word quot -- )
[ def>> first pprint-c-type ]
@ -79,7 +79,7 @@ PREDICATE: alien-function-alias-word < word
} 1&& ;
M: alien-function-alias-word definer
drop \ FUNCTION-ALIAS: f ;
drop \ \FUNCTION-ALIAS: f ;
M: alien-function-alias-word definition drop f ;
M: alien-function-alias-word synopsis*
{
@ -95,7 +95,7 @@ PREDICATE: alien-function-word < alien-function-alias-word
[ def>> third ] [ name>> ] bi = ;
M: alien-function-word definer
drop \ FUNCTION: f ;
drop \ \FUNCTION: f ;
M: alien-function-word synopsis*
{
[ seeing-word ]
@ -108,7 +108,7 @@ PREDICATE: alien-callback-type-word < typedef-word
"callback-effect" word-prop >boolean ;
M: alien-callback-type-word definer
drop \ CALLBACK: f ;
drop \ \CALLBACK: f ;
M: alien-callback-type-word definition drop f ;
M: alien-callback-type-word synopsis*
{
@ -126,7 +126,7 @@ M: alien-callback-type-word synopsis*
} cleave ;
M: enum-c-type-word definer
drop \ ENUM: \ ; ;
drop \ \ENUM: \ \; ;
M: enum-c-type-word synopsis*
{
[ seeing-word ]

View File

@ -86,7 +86,7 @@ M: bit-array resize
M: bit-array byte-length length bits>bytes ; inline
SYNTAX: \?{ \ } [ >bit-array ] parse-literal ;
SYNTAX: \?{ \ \} [ >bit-array ] parse-literal ;
: integer>bit-array ( n -- bit-array )
dup 0 =

View File

@ -1,6 +1,6 @@
USING: bit-arrays kernel prettyprint.custom ;
IN: bit-arrays.prettyprint
M: bit-array pprint-delims drop \ ?{ \ } ;
M: bit-array pprint-delims drop \ \?{ \ \} ;
M: bit-array >pprint-sequence ;
M: bit-array pprint* pprint-object ;

View File

@ -7,7 +7,7 @@ IN: bit-vectors
VECTORIZED: bit bit-array <bit-array>
SYNTAX: \?V{ \ } [ >bit-vector ] parse-literal ;
SYNTAX: \?V{ \ \} [ >bit-vector ] parse-literal ;
M: bit-vector contract 2drop ;

View File

@ -2,6 +2,6 @@ USING: bit-vectors kernel prettyprint.custom ;
IN: bit-vectors.prettyprint
M: bit-vector >pprint-sequence ;
M: bit-vector pprint-delims drop \ ?V{ \ } ;
M: bit-vector pprint-delims drop \ \?V{ \ \} ;
M: bit-vector pprint* pprint-object ;

View File

@ -13,36 +13,36 @@ IN: classes.struct.prettyprint
: struct-definer-word ( class -- word )
struct-slots
{
{ [ dup [ packed?>> ] all? ] [ drop \ PACKED-STRUCT: ] }
{ [ dup length 1 <= ] [ drop \ STRUCT: ] }
{ [ dup [ offset>> 0 = ] all? ] [ drop \ UNION-STRUCT: ] }
[ drop \ STRUCT: ]
{ [ dup [ packed?>> ] all? ] [ drop \ \PACKED-STRUCT: ] }
{ [ dup length 1 <= ] [ drop \ \STRUCT: ] }
{ [ dup [ offset>> 0 = ] all? ] [ drop \ \UNION-STRUCT: ] }
[ drop \ \STRUCT: ]
} cond ;
: struct>assoc ( struct -- assoc )
[ class-of struct-slots ] [ struct-slot-values ] bi zip ;
: pprint-struct-slot ( slot -- )
<flow \ { pprint-word
<flow \ \{ pprint-word
f <inset {
[ name>> text ]
[ type>> pprint-c-type ]
[ read-only>> [ \ read-only pprint-word ] when ]
[ initial>> [ \ initial: pprint-word pprint* ] when* ]
[ initial>> [ \ \initial: pprint-word pprint* ] when* ]
[
dup struct-bit-slot-spec?
[ \ bits: pprint-word bits>> pprint* ]
[ \ \bits: pprint-word bits>> pprint* ]
[ drop ] if
]
} cleave block>
\ } pprint-word block> ;
\ \} pprint-word block> ;
: pprint-struct ( struct -- )
[
[ \ S{ ] dip
[ \ \S{ ] dip
[ class-of ]
[ struct>assoc [ [ name>> ] dip ] assoc-map ] bi
\ } (pprint-tuple)
\ \} (pprint-tuple)
] ?pprint-tuple ;
: pprint-struct-pointer ( struct -- )
@ -56,7 +56,7 @@ M: struct-class see-class*
block> pprint-; block> ;
M: struct pprint-delims
drop \ S{ \ } ;
drop \ \S{ \ \} ;
M: struct >pprint-sequence
[ class-of ] [ struct-slot-values ] bi class-slot-sequence ;

View File

@ -364,7 +364,7 @@ PRIVATE>
<PRIVATE
: parse-struct-slot ( -- slot )
scan-token scan-c-type \ } parse-until <struct-slot-spec> ;
scan-token scan-c-type \ \} parse-until <struct-slot-spec> ;
: parse-struct-slots ( slots -- slots' more? )
scan-token {
@ -397,10 +397,10 @@ SYNTAX: S@
<PRIVATE
: scan-c-type* ( -- c-type/param )
scan-token dup "{" = [ drop \ } parse-until >array ] [ search ] if ;
scan-token dup "{" = [ drop \ \} parse-until >array ] [ search ] if ;
: parse-struct-slot* ( accum -- accum )
scan-string-param scan-c-type* \ } parse-until
scan-string-param scan-c-type* \ \} parse-until
[ <struct-slot-spec> suffix! ] 3curry append! ;
: parse-struct-slots* ( accum -- accum more? )

View File

@ -213,6 +213,6 @@ PRIVATE>
INSTANCE: dlist deque
SYNTAX: \DL{ \ } [ >dlist ] parse-literal ;
SYNTAX: \DL{ \ \} [ >dlist ] parse-literal ;
{ "dlists" "prettyprint" } "dlists.prettyprint" require-when

View File

@ -3,7 +3,7 @@
USING: dlists kernel prettyprint.custom ;
IN: dlists.prettyprint
M: dlist pprint-delims drop \ DL{ \ } ;
M: dlist pprint-delims drop \ \DL{ \ \} ;
M: dlist >pprint-sequence dlist>sequence ;
M: dlist pprint-narrow? drop f ;
M: dlist pprint* pprint-object ;

View File

@ -23,7 +23,7 @@ SYNTAX: \FUNCTOR-SYNTAX:
scan-token >string-param ;
: scan-c-type-param ( -- c-type/param )
scan-token dup "{" = [ drop \ } parse-until >array ] [ >string-param ] if ;
scan-token dup "{" = [ drop \ \} parse-until >array ] [ >string-param ] if ;
: define* ( word def -- ) over set-last-word define ;

View File

@ -37,6 +37,6 @@ M: identity-hash-set clone
M: identity-hash-set set-like
drop dup identity-hash-set? [ ?members >identity-hash-set ] unless ; inline
SYNTAX: \IHS{ \ } [ >identity-hash-set ] parse-literal ;
SYNTAX: \IHS{ \ \} [ >identity-hash-set ] parse-literal ;
{ "hash-sets.identity" "prettyprint" } "hash-sets.identity.prettyprint" require-when

View File

@ -5,4 +5,4 @@ USING: hash-sets.identity kernel prettyprint.custom ;
IN: hash-sets.identity.prettyprint
M: identity-hash-set pprint-delims drop \ IHS{ \ } ;
M: identity-hash-set pprint-delims drop \ \IHS{ \ \} ;

View File

@ -5,4 +5,4 @@ USING: hash-sets.sequences kernel prettyprint.custom ;
IN: hash-sets.sequences.prettyprint
M: sequence-hash-set pprint-delims drop \ SHS{ \ } ;
M: sequence-hash-set pprint-delims drop \ \SHS{ \ \} ;

View File

@ -36,6 +36,6 @@ M: sequence-hash-set clone
: >sequence-hash-set ( members -- shash-set )
[ <sequence-wrapper> ] map >hash-set sequence-hash-set boa ;
SYNTAX: \SHS{ \ } [ >sequence-hash-set ] parse-literal ;
SYNTAX: \SHS{ \ \} [ >sequence-hash-set ] parse-literal ;
{ "hash-sets.sequences" "prettyprint" } "hash-sets.sequences.prettyprint" require-when

View File

@ -5,4 +5,4 @@ USING: hashtables.identity kernel prettyprint.custom ;
IN: hashtables.identity.prettyprint
M: identity-hashtable pprint-delims drop \ IH{ \ } ;
M: identity-hashtable pprint-delims drop \ \IH{ \ \} ;

View File

@ -5,4 +5,4 @@ USING: hashtables.sequences kernel prettyprint.custom ;
IN: hashtables.sequences.prettyprint
M: sequence-hashtable pprint-delims drop \ SH{ \ } ;
M: sequence-hashtable pprint-delims drop \ \SH{ \ \} ;

View File

@ -38,6 +38,6 @@ M: sequence-hashtable clone
M: sequence-hashtable new-assoc drop <sequence-hashtable> ;
SYNTAX: \SH{ \ } [ >sequence-hashtable ] parse-literal ;
SYNTAX: \SH{ \ \} [ >sequence-hashtable ] parse-literal ;
{ "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when

View File

@ -6,7 +6,7 @@ IN: help.definitions
! Definition protocol implementation
M: link definer drop \ ARTICLE: \ ; ;
M: link definer drop \ \ARTICLE: \ \; ;
M: link where name>> lookup-article loc>> ;
@ -21,7 +21,7 @@ M: link synopsis*
dup name>> pprint*
article-title pprint* ;
M: word-link definer drop \ HELP: \ ; ;
M: word-link definer drop \ \HELP: \ \; ;
M: word-link where name>> "help-loc" word-prop ;

View File

@ -61,6 +61,6 @@ M: linked-assoc assoc-like
M: linked-assoc equal?
over linked-assoc? [ [ dlist>> ] bi@ = ] [ 2drop f ] if ;
SYNTAX: \LH{ \ } [ check-hashtable >linked-hash ] parse-literal ;
SYNTAX: \LH{ \ \} [ check-hashtable >linked-hash ] parse-literal ;
{ "linked-assocs" "prettyprint" } "linked-assocs.prettyprint" require-when

View File

@ -5,7 +5,7 @@ IN: linked-assocs.prettyprint
PREDICATE: linked-hash < linked-assoc
[ class-of linked-assoc = ] [ assoc>> hashtable? ] bi and ;
M: linked-hash pprint-delims drop \ LH{ \ } ;
M: linked-hash pprint-delims drop \ \LH{ \ \} ;
M: linked-hash >pprint-sequence >alist ;

View File

@ -23,9 +23,9 @@ PRIVATE>
SYNTAX: $ scan-word expand-literal >vector ;
SYNTAX: \$[ parse-quotation with-datastack >vector ;
SYNTAX: \${ \ } [ expand-literals ] parse-literal ;
SYNTAX: \${ \ \} [ expand-literals ] parse-literal ;
SYNTAX: \flags{
\ } [
\ \} [
expand-literals
0 [ bitor ] reduce
] parse-literal ;

View File

@ -16,19 +16,19 @@ IN: locals.prettyprint
M: lambda pprint*
<flow
\ |[ pprint-word
\ \|[ pprint-word
dup vars>> pprint-vars
"|" text
f <inset body>> pprint-elements block>
\ ] pprint-word
\ \] pprint-word
block> ;
: pprint-let ( let word -- )
pprint-word
<block body>> pprint-elements block>
\ ] pprint-word ;
\ \] pprint-word ;
M: let pprint* \ let[ pprint-let ;
M: let pprint* \ \let[ pprint-let ;
M: def pprint*
dup local>> word?

View File

@ -40,10 +40,10 @@ ERROR: malformed-complex obj ;
: parse-complex ( seq -- complex )
dup length 2 = [ first2-unsafe rect> ] [ malformed-complex ] if ;
SYNTAX: \C{ \ } [ parse-complex ] parse-literal ;
SYNTAX: \C{ \ \} [ parse-complex ] parse-literal ;
USE: prettyprint.custom
M: complex pprint* pprint-object ;
M: complex pprint-delims drop \ C{ \ } ;
M: complex pprint-delims drop \ \C{ \ \} ;
M: complex >pprint-sequence >rect 2array ;

View File

@ -59,9 +59,9 @@ INLINE-FUNCTOR: simd-128-cord ( type/2: existing-word type: name -- ) [[
M: ${type} pprint* pprint-object ;
<<
SYNTAX: ${type}{ \ } [ >${type} ] parse-literal ;
SYNTAX: \${type}{ \ \} [ >${type} ] parse-literal ;
>>
M: ${type} pprint-delims drop \ ${type}{ \ } ;
M: ${type} pprint-delims drop \ \${type}{ \ \} ;
]]
>>

View File

@ -307,7 +307,7 @@ c:<c-type>
: ${type}-with ( n -- v ) $[ ${type}-coercer ] call \ ${type}-rep (simd-with) \ ${type} boa ; inline
: ${type}-cast ( v -- v' ) underlying>> \ ${type} boa ; inline
: >${type} ( seq -- simd ) \ ${type} new clone-like ; inline
SYNTAX: ${type}{ \ } [ >${type} ] parse-literal ;
SYNTAX: \${type}{ \ \} [ >${type} ] parse-literal ;
M: ${type} new-underlying drop \ ${type} boa ; inline
M: ${type} simd-rep drop ${type}-rep ; inline
@ -336,7 +336,7 @@ DEFER: ${type}-boa
$[ $[ ${type}-rep rep-length ] "n" <array> { "v" } <effect> ] define-inline
>>
M: ${type} pprint-delims drop \ ${type}{ \ } ;
M: ${type} pprint-delims drop \ \${type}{ \ \} ;
INSTANCE: ${type} sequence

View File

@ -67,10 +67,10 @@ M: nibble-array resize
M: nibble-array byte-length length nibbles>bytes ;
SYNTAX: \N{ \ } [ >nibble-array ] parse-literal ;
SYNTAX: \N{ \ \} [ >nibble-array ] parse-literal ;
INSTANCE: nibble-array sequence
M: nibble-array pprint-delims drop \ N{ \ } ;
M: nibble-array pprint-delims drop \ \N{ \ \} ;
M: nibble-array >pprint-sequence ;
M: nibble-array pprint* pprint-object ;

View File

@ -53,9 +53,9 @@ M: persistent-hash hashcode* nip assoc-size ;
M: persistent-hash clone ;
SYNTAX: \PH{ \ } [ >persistent-hash ] parse-literal ;
SYNTAX: \PH{ \ \} [ >persistent-hash ] parse-literal ;
M: persistent-hash pprint-delims drop \ PH{ \ } ;
M: persistent-hash pprint-delims drop \ \PH{ \ \} ;
M: persistent-hash >pprint-sequence >alist ;
M: persistent-hash pprint* pprint-object ;

View File

@ -181,9 +181,9 @@ M: persistent-vector equal?
: >persistent-vector ( seq -- pvec )
T{ persistent-vector } like ;
SYNTAX: \PV{ \ } [ >persistent-vector ] parse-literal ;
SYNTAX: \PV{ \ \} [ >persistent-vector ] parse-literal ;
M: persistent-vector pprint-delims drop \ PV{ \ } ;
M: persistent-vector pprint-delims drop \ \PV{ \ \} ;
M: persistent-vector >pprint-sequence ;
M: persistent-vector pprint* pprint-object ;

View File

@ -54,7 +54,7 @@ M: word pprint-class pprint-word ;
<block swap pprint-word call block> ; inline
M: parsing-word pprint*
\ postpone: [ pprint-word ] pprint-prefix ;
\ \postpone: [ pprint-word ] pprint-prefix ;
M: word pprint*
[ pprint-word ] [ ?start-group ] [ ?end-group ] tri ;
@ -84,7 +84,7 @@ M: real pprint*
M: float pprint*
dup fp-nan? [
\ nan: [ fp-nan-payload >hex text ] pprint-prefix
\ \nan: [ fp-nan-payload >hex text ] pprint-prefix
] [
call-next-method
] if ;
@ -166,9 +166,9 @@ M: pathname pprint*
[ class-of all-slots ] [ tuple-slots ] bi zip filter-tuple-assoc ;
: pprint-slot-value ( name value -- )
<flow \ { pprint-word
<flow \ \{ pprint-word
[ text ] [ f <inset pprint* block> ] bi*
\ } pprint-word block> ;
\ \} pprint-word block> ;
: (pprint-tuple) ( opener class slots closer -- )
<flow {
@ -182,7 +182,7 @@ M: pathname pprint*
[ boa-tuples? get [ pprint-object ] ] dip [ check-recursion ] curry if ; inline
: pprint-tuple ( tuple -- )
[ [ \ T{ ] dip [ class-of ] [ tuple>assoc ] bi \ } (pprint-tuple) ] ?pprint-tuple ;
[ [ \ \T{ ] dip [ class-of ] [ tuple>assoc ] bi \ \} (pprint-tuple) ] ?pprint-tuple ;
M: tuple pprint*
pprint-tuple ;
@ -207,22 +207,22 @@ M: tuple pprint*
[ [ pprint* ] each ] dip
[ number>string "~" " more~" surround text ] when* ;
M: quotation pprint-delims drop \ [ \ ] ;
M: curried pprint-delims drop \ [ \ ] ;
M: composed pprint-delims drop \ [ \ ] ;
M: array pprint-delims drop \ { \ } ;
M: byte-array pprint-delims drop \ B{ \ } ;
M: byte-vector pprint-delims drop \ BV{ \ } ;
M: vector pprint-delims drop \ V{ \ } ;
M: hashtable pprint-delims drop \ H{ \ } ;
M: tuple pprint-delims drop \ T{ \ } ;
M: wrapper pprint-delims drop \ W{ \ } ;
M: callstack pprint-delims drop \ CS{ \ } ;
M: hash-set pprint-delims drop \ HS{ \ } ;
M: anonymous-union pprint-delims drop \ union{ \ } ;
M: anonymous-intersection pprint-delims drop \ intersection{ \ } ;
M: anonymous-complement pprint-delims drop \ not{ \ } ;
M: maybe pprint-delims drop \ maybe{ \ } ;
M: quotation pprint-delims drop \ \[ \ \] ;
M: curried pprint-delims drop \ \[ \ \] ;
M: composed pprint-delims drop \ \[ \ \] ;
M: array pprint-delims drop \ \{ \ \} ;
M: byte-array pprint-delims drop \ \B{ \ \} ;
M: byte-vector pprint-delims drop \ \BV{ \ \} ;
M: vector pprint-delims drop \ \V{ \ \} ;
M: hashtable pprint-delims drop \ \H{ \ \} ;
M: tuple pprint-delims drop \ \T{ \ \} ;
M: wrapper pprint-delims drop \ \W{ \ \} ;
M: callstack pprint-delims drop \ \CS{ \ \} ;
M: hash-set pprint-delims drop \ \HS{ \ \} ;
M: anonymous-union pprint-delims drop \ \union{ \ \} ;
M: anonymous-intersection pprint-delims drop \ \intersection{ \ \} ;
M: anonymous-complement pprint-delims drop \ \not{ \ \} ;
M: maybe pprint-delims drop \ \maybe{ \ \} ;
M: object >pprint-sequence ;
M: vector >pprint-sequence ;
@ -282,6 +282,6 @@ M: maybe pprint* pprint-object ;
M: wrapper pprint*
{
{ [ dup wrapped>> method? ] [ wrapped>> pprint* ] }
{ [ dup wrapped>> word? ] [ <block \ \ pprint-word wrapped>> pprint-word block> ] }
{ [ dup wrapped>> word? ] [ <block \ \\ pprint-word wrapped>> pprint-word block> ] }
[ pprint-object ]
} cond ;

View File

@ -406,7 +406,7 @@ M: integer harhar M\\ integer harhar drop ;
M: maybe{ har } harhar ;
USING: kernel math prettyprint.tests ;
M: integer harhar M\\ integer harhar drop ;\n"
M: integer harhar M\\\\ integer harhar drop ;\n"
} [
[ \ harhar see-methods ] with-string-writer
] unit-test

View File

@ -124,7 +124,7 @@ M: word declarations.
postpone: flushable
} [ declaration. ] with each ;
: pprint-; ( -- ) \ ; pprint-word ;
: pprint-semi ( -- ) \ \; pprint-word ;
M: object see*
[
@ -139,43 +139,43 @@ M: object see*
GENERIC: see-class* ( word -- )
M: union-class see-class*
<colon \ UNION: pprint-word
<colon \ \UNION: pprint-word
dup pprint-word
class-members pprint-elements pprint-; block> ;
class-members pprint-elements pprint-semi block> ;
M: intersection-class see-class*
<colon \ INTERSECTION: pprint-word
<colon \ \INTERSECTION: pprint-word
dup pprint-word
class-participants pprint-elements pprint-; block> ;
class-participants pprint-elements pprint-semi block> ;
M: mixin-class see-class*
<block \ MIXIN: pprint-word
<block \ \MIXIN: pprint-word
dup pprint-word <block
dup class-members [
hard add-line-break
\ INSTANCE: pprint-word pprint-word pprint-word
\ \INSTANCE: pprint-word pprint-word pprint-word
] with each block> block> ;
M: predicate-class see-class*
<colon \ PREDICATE: pprint-word
<colon \ \PREDICATE: pprint-word
dup pprint-word
"<" text
dup superclass-of pprint-word
<block
"predicate-definition" word-prop pprint-elements
pprint-; block> block> ;
pprint-semi block> block> ;
M: singleton-class see-class* ( class -- )
\ SINGLETON: pprint-word pprint-word ;
\ \SINGLETON: pprint-word pprint-word ;
GENERIC: pprint-slot-name ( object -- )
M: string pprint-slot-name text ;
M: array pprint-slot-name
<flow \ { pprint-word
<flow \ \{ pprint-word
f <inset unclip text pprint-elements block>
\ } pprint-word block> ;
\ \} pprint-word block> ;
: unparse-slot ( slot-spec -- array )
[
@ -205,11 +205,11 @@ M: array pprint-slot-name
superclass-of dup tuple eq? [ drop ] [ "<" text pprint-word ] if ;
M: tuple-class see-class*
<colon \ TUPLE: pprint-word
<colon \ \TUPLE: pprint-word
{
[ pprint-word ]
[ superclass. ]
[ <block "slots" word-prop [ pprint-slot ] each block> pprint-; ]
[ <block "slots" word-prop [ pprint-slot ] each block> pprint-semi ]
[ tuple-declarations. ]
} cleave
block> ;
@ -218,9 +218,9 @@ M: word see-class* drop ;
M: builtin-class see-class*
<block
\ BUILTIN: pprint-word
\ \BUILTIN: pprint-word
[ pprint-word ]
[ <block "slots" word-prop [ pprint-slot ] each pprint-; block> ] bi
[ <block "slots" word-prop [ pprint-slot ] each pprint-semi block> ] bi
block> ;
: see-class ( class -- )
@ -239,11 +239,11 @@ M: word see*
] tri ;
M: error-class see-class*
<colon \ ERROR: pprint-word
<colon \ \ERROR: pprint-word
{
[ pprint-word ]
[ superclass. ]
[ <block "slots" word-prop [ name>> pprint-slot-name ] each block> pprint-; ]
[ <block "slots" word-prop [ name>> pprint-slot-name ] each block> pprint-semi ]
[ tuple-declarations. ]
} cleave
block> ;

View File

@ -68,7 +68,7 @@ INSTANCE: ${A} specialized-array-mixin
[ \ ${type} (underlying) ] keep ${<direct-A>} ; inline
>>
SYNTAX: ${A}{ \ } [ \ ${type} >c-array ] parse-literal ;
SYNTAX: \${A}{ \ \} [ \ ${type} >c-array ] parse-literal ;
M: ${A} direct-like drop ${<direct-A>} ; inline
@ -98,7 +98,7 @@ M: ${A} element-size drop \ ${type} heap-size ; inline
M: ${A} underlying-type drop \ ${type} ;
M: ${A} pprint-delims drop \ ${A}{ \ } ;
M: ${A} pprint-delims drop \ \${A}{ \ \} ;
M: ${A} >pprint-sequence ;

View File

@ -25,7 +25,7 @@ SPECIALIZED-ARRAY: ${type}
VECTORIZED: ${type} ${type}-array <${type}-array>
>>
SYNTAX: ${type}-vector{ \ } [ >${type}-vector ] parse-literal ;
SYNTAX: ${type}-vector{ \ \} [ >${type}-vector ] parse-literal ;
INSTANCE: ${type}-vector specialized-vector
@ -33,7 +33,7 @@ M: ${type}-vector contract 2drop ; inline
M: ${type}-vector element-size drop \ ${type} heap-size ; inline
M: ${type}-vector pprint-delims drop \ ${type}-vector{ \ } ;
M: ${type}-vector pprint-delims drop \ \${type}-vector{ \ \} ;
M: ${type}-vector >pprint-sequence ;

View File

@ -32,7 +32,7 @@ PRIVATE>
: >suffix-array ( seq -- suffix-array )
members [ suffixes ] map concat natural-sort ;
SYNTAX: \SA{ \ } [ >suffix-array ] parse-literal ;
SYNTAX: \SA{ \ \} [ >suffix-array ] parse-literal ;
: query ( begin suffix-array -- matches )
[ find-index ] 2keep '[ _ _ (query) ] [ { } ] if* ;

View File

@ -5,8 +5,8 @@ IN: typed.prettyprint
PREDICATE: typed-lambda-word < lambda-word
"typed-word" word-prop >boolean ;
M: typed-word definer drop \ TYPED: \ ; ;
M: typed-lambda-word definer drop \ TYPED:: \ ; ;
M: typed-word definer drop \ \TYPED: \ \; ;
M: typed-lambda-word definer drop \ \TYPED:: \ \; ;
M: typed-word definition "typed-def" word-prop ;
M: typed-word declarations. "typed-word" word-prop declarations. ;

View File

@ -599,7 +599,7 @@ PRIVATE>
] ;
COCOA-METHOD: id validAttributesForMarkedText [
NSArray "NSMarkedClauseSegment" <NSString> send: arrayWithObject:
NSArray "NSMarkedClauseSegment" <NSString> send: \arrayWithObject:
] ;
COCOA-METHOD: id attributedSubstringForProposedRange: NSRange aRange

View File

@ -23,7 +23,7 @@ SYMBOLS: Cn Lu Ll Lt Lm Lo Mn Mc Me Nd Nl No Pc Pd Ps Pe Pi Pf Po Sm Sc Sk So Zs
[category] [ not ] compose integer-predicate-class ;
: parse-category ( -- word tokens quot )
scan-new-class \ ; parse-until { | } split1
scan-new-class \ \; parse-until { | } split1
[ [ name>> categories-map at ] B{ } map-as ]
[ [ [ ] like ] [ [ drop f ] ] if* ] bi* ;

View File

@ -5,5 +5,5 @@ prettyprint.backend urls ;
IN: urls.prettyprint
M: url pprint*
\ url" record-vocab
\ \url" record-vocab
dup present "url\"" "\"" pprint-string ;

View File

@ -1,10 +1,10 @@
USING: assocs kernel prettyprint.custom vlists ;
IN: vlists.prettyprint
M: vlist pprint-delims drop \ VL{ \ } ;
M: vlist pprint-delims drop \ \VL{ \ \} ;
M: vlist >pprint-sequence ;
M: vlist pprint* pprint-object ;
M: valist pprint-delims drop \ VA{ \ } ;
M: valist pprint-delims drop \ \VA{ \ \} ;
M: valist >pprint-sequence >alist ;
M: valist pprint* pprint-object ;

View File

@ -50,7 +50,7 @@ M: vlist like
INSTANCE: vlist immutable-sequence
SYNTAX: \VL{ \ } [ >vlist ] parse-literal ;
SYNTAX: \VL{ \ \} [ >vlist ] parse-literal ;
TUPLE: valist { vlist vlist read-only } ;
@ -84,6 +84,6 @@ M: valist assoc-like
INSTANCE: valist assoc
SYNTAX: \VA{ \ } [ >valist ] parse-literal ;
SYNTAX: \VA{ \ \} [ >valist ] parse-literal ;
{ "vlists" "prettyprint" } "vlists.prettyprint" require-when

View File

@ -10,7 +10,7 @@ IN: vocabs.prettyprint
[ vocab-name ] [ lookup-vocab vocab-style ] bi styled-text ;
: pprint-in ( vocab -- )
[ \ IN: pprint-word pprint-vocab ] with-pprint ;
[ \ \IN: pprint-word pprint-vocab ] with-pprint ;
<PRIVATE
@ -20,9 +20,9 @@ IN: vocabs.prettyprint
: pprint-using ( seq -- )
"syntax" lookup-vocab '[ _ = ] reject
sort-vocabs [
\ USING: pprint-word
\ \USING: pprint-word
[ pprint-vocab ] each
\ ; pprint-word
\ \; pprint-word
] with-pprint ;
GENERIC: pprint-qualified ( qualified -- )
@ -30,33 +30,33 @@ GENERIC: pprint-qualified ( qualified -- )
M: qualified pprint-qualified ( qualified -- )
[
dup [ vocab>> vocab-name ] [ prefix>> ] bi = [
\ QUALIFIED: pprint-word
\ \QUALIFIED: pprint-word
vocab>> pprint-vocab
] [
\ QUALIFIED-WITH: pprint-word
\ \QUALIFIED-WITH: pprint-word
[ vocab>> pprint-vocab ] [ prefix>> text ] bi
] if
] with-pprint ;
M: from pprint-qualified ( from -- )
[
\ FROM: pprint-word
\ \FROM: pprint-word
[ vocab>> pprint-vocab "=>" text ]
[ names>> [ text ] each ] bi
\ ; pprint-word
\ \; pprint-word
] with-pprint ;
M: exclude pprint-qualified ( exclude -- )
[
\ EXCLUDE: pprint-word
\ \EXCLUDE: pprint-word
[ vocab>> pprint-vocab "=>" text ]
[ names>> [ text ] each ] bi
\ ; pprint-word
\ \; pprint-word
] with-pprint ;
M: rename pprint-qualified ( rename -- )
[
\ RENAME: pprint-word
\ \RENAME: pprint-word
[ word>> text ]
[ vocab>> text "=>" text ]
[ words>> >alist first first text ]

View File

@ -31,7 +31,7 @@ ERROR: duplicate-slot-names names ;
ERROR: invalid-slot-name name ;
: parse-long-slot-name ( -- spec )
[ scan-token , \ } parse-until % ] { } make ;
[ scan-token , \ \} parse-until % ] { } make ;
: parse-slot-name-delim ( end-delim string/f -- ? )
! Check for mistakes of this form:
@ -109,7 +109,7 @@ M: tuple-class boa>object
: parse-tuple-literal-slots ( class slots -- tuple )
scan-token {
{ "f" [ drop \ } parse-until boa>object ] }
{ "f" [ drop \ \} parse-until boa>object ] }
{ "{" [ 2dup parse-slot-values assoc>object ] }
{ "}" [ drop new ] }
[ bad-literal-tuple ]

View File

@ -186,7 +186,7 @@ M: protocol forget*
M: protocol definition protocol-words show-words ;
M: protocol definer drop \ PROTOCOL: \ ; ;
M: protocol definer drop \ \PROTOCOL: \ \; ;
M: protocol group-words protocol-words ;

View File

@ -165,7 +165,7 @@ PREDICATE: default-method < word "default" word-prop ;
! Definition protocol
M: method definer
drop \ M: \ ; ;
drop \ \M: \ \; ;
M: method forget*
dup "forgotten" word-prop [ drop ] [

View File

@ -42,9 +42,9 @@ ERROR: bad-method-effect ;
: parse-method-definition ( -- quot )
scan-datum {
{ \ ( [ ")" parse-effect check-method-effect parse-definition ] }
{ \ ; [ [ ] ] }
[ ?execute-parsing \ ; parse-until append >quotation ]
{ \ \( [ ")" parse-effect check-method-effect parse-definition ] }
{ \ \; [ [ ] ] }
[ ?execute-parsing \ \; parse-until append >quotation ]
} case ;
: (M:) ( -- method def )

View File

@ -25,7 +25,7 @@ M: lambda-word subwords
[ vars>> % ] [ body>> [ lambda-subwords ] each ] bi
] { } make ;
M: lambda-word definer drop \ :: \ ; ;
M: lambda-word definer drop \ \:: \ \; ;
M: lambda-word definition
"lambda" word-prop body>> ;
@ -35,7 +35,7 @@ M: lambda-word reset-word
INTERSECTION: lambda-macro macro lambda-word ;
M: lambda-macro definer drop \ MACRO:: \ ; ;
M: lambda-macro definer drop \ \MACRO:: \ \; ;
M: lambda-macro definition
"lambda" word-prop body>> ;
@ -45,7 +45,7 @@ M: lambda-macro reset-word
INTERSECTION: lambda-method method lambda-word ;
M: lambda-method definer drop \ M:: \ ; ;
M: lambda-method definer drop \ \M:: \ \; ;
M: lambda-method definition
"lambda" word-prop body>> ;
@ -55,7 +55,7 @@ M: lambda-method reset-word
INTERSECTION: lambda-memoized memoized lambda-word ;
M: lambda-memoized definer drop \ MEMO:: \ ; ;
M: lambda-memoized definer drop \ \MEMO:: \ \; ;
M: lambda-memoized definition
"lambda" word-prop body>> ;

View File

@ -40,7 +40,7 @@ SINGLETON: lambda-parser
] with-variables ; inline
: (parse-lambda) ( assoc -- quot )
[ \ ] parse-until >quotation ] with-lambda-scope ;
[ \ \] parse-until >quotation ] with-lambda-scope ;
: parse-lambda ( -- lambda )
parse-local-defs

View File

@ -33,7 +33,7 @@ PREDICATE: macro < word "macro" word-prop >boolean ;
M: macro make-inline cannot-be-inline ;
M: macro definer drop \ MACRO: \ ; ;
M: macro definer drop \ \MACRO: \ \; ;
M: macro definition "macro" word-prop ;

View File

@ -75,7 +75,7 @@ PRIVATE>
PREDICATE: memoized < word "memoize" word-prop >boolean ;
M: memoized definer drop \ MEMO: \ ; ;
M: memoized definer drop \ \MEMO: \ \; ;
M: memoized definition "memo-quot" word-prop ;

View File

@ -174,7 +174,7 @@ SYMBOL: quotation-parser
HOOK: parse-quotation quotation-parser ( -- quot )
M: f parse-quotation \ ] parse-until >quotation ;
M: f parse-quotation \ \] parse-until >quotation ;
: (parse-lines) ( lexer -- quot )
[ f parse-until >quotation ] with-lexer ;
@ -186,10 +186,10 @@ M: f parse-quotation \ ] parse-until >quotation ;
[ parse-until ] dip call suffix! ; inline
: parse-definition ( -- quot )
\ ; parse-until >quotation ;
\ \; parse-until >quotation ;
: parse-array-def ( -- array )
\ ; parse-until >array ;
\ \; parse-until >array ;
ERROR: bad-number ;

View File

@ -143,19 +143,19 @@ IN: bootstrap.syntax
] define-core-syntax
"[" [ parse-quotation suffix! ] define-core-syntax
"{" [ \ } [ >array ] parse-literal ] define-core-syntax
"V{" [ \ } [ >vector ] parse-literal ] define-core-syntax
"B{" [ \ } [ >byte-array ] parse-literal ] define-core-syntax
"BV{" [ \ } [ >byte-vector ] parse-literal ] define-core-syntax
"H{" [ \ } [ parse-hashtable ] parse-literal ] define-core-syntax
"{" [ \ \} [ >array ] parse-literal ] define-core-syntax
"V{" [ \ \} [ >vector ] parse-literal ] define-core-syntax
"B{" [ \ \} [ >byte-array ] parse-literal ] define-core-syntax
"BV{" [ \ \} [ >byte-vector ] parse-literal ] define-core-syntax
"H{" [ \ \} [ parse-hashtable ] parse-literal ] define-core-syntax
"T{" [ parse-tuple-literal suffix! ] define-core-syntax
"TH{" [ parse-tuple-hash-literal suffix! ] define-core-syntax
"W{" [ \ } [ first <wrapper> ] parse-literal ] define-core-syntax
"HS{" [ \ } [ >hash-set ] parse-literal ] define-core-syntax
"W{" [ \ \} [ first <wrapper> ] parse-literal ] define-core-syntax
"HS{" [ \ \} [ >hash-set ] parse-literal ] define-core-syntax
"postpone:" [ scan-syntax-word suffix! ] define-core-syntax
"\\" [ scan-word <wrapper> suffix! ] define-core-syntax
"M\\\\" [ scan-object scan-object lookup-method <wrapper> suffix! ] define-core-syntax
"M\\\\" [ scan-word scan-word lookup-method <wrapper> suffix! ] define-core-syntax
"inline" [ last-word make-inline ] define-core-syntax
"private" [ last-word make-private ] define-core-syntax
"recursive" [ last-word make-recursive ] define-core-syntax
@ -324,19 +324,19 @@ IN: bootstrap.syntax
] define-core-syntax
"maybe{" [
\ } [ <anonymous-union> <maybe> ] parse-literal
\ \} [ <anonymous-union> <maybe> ] parse-literal
] define-core-syntax
"not{" [
\ } [ <anonymous-union> <anonymous-complement> ] parse-literal
\ \} [ <anonymous-union> <anonymous-complement> ] parse-literal
] define-core-syntax
"intersection{" [
\ } [ <anonymous-intersection> ] parse-literal
\ \} [ <anonymous-intersection> ] parse-literal
] define-core-syntax
"union{" [
\ } [ <anonymous-union> ] parse-literal
\ \} [ <anonymous-union> ] parse-literal
] define-core-syntax
"initial:" "syntax" lookup-word define-symbol
@ -347,7 +347,7 @@ IN: bootstrap.syntax
"execute(" [ \ execute-effect parse-call-paren ] define-core-syntax
"IH{" [ \ } [ >identity-hashtable ] parse-literal ] define-core-syntax
"IH{" [ \ \} [ >identity-hashtable ] parse-literal ] define-core-syntax
"::" [ (::) apply-inlined-effects define-declared ] define-core-syntax
"M::" [ (M::) define ] define-core-syntax

View File

@ -25,7 +25,7 @@ M: word execute (execute) ;
M: word <=> [ [ name>> ] [ vocabulary>> ] bi 2array ] compare ;
M: word definer drop \ : \ ; ;
M: word definer drop \ \: \ \; ;
M: word definition def>> ;
@ -235,7 +235,7 @@ ERROR: bad-create name vocab ;
PREDICATE: parsing-word < word "parsing" word-prop ;
M: parsing-word definer drop \ SYNTAX: \ ; ;
M: parsing-word definer drop \ \SYNTAX: \ \; ;
: define-syntax ( word quot -- )
[ drop ] [ define ] 2bi t "parsing" set-word-prop ;

View File

@ -192,11 +192,11 @@ TUPLE: row-traverser shaped-array index ;
GENERIC: next-index ( object -- index )
SYNTAX: \sa{ \ } [ >shaped-array ] parse-literal ;
SYNTAX: \sa{ \ \} [ >shaped-array ] parse-literal ;
! M: row-array pprint* shaped-array>array pprint* ;
! M: col-array pprint* shaped-array>array flip pprint* ;
M: shaped-array pprint-delims drop \ sa{ \ } ;
M: shaped-array pprint-delims drop \ \sa{ \ \} ;
M: shaped-array >pprint-sequence shaped-array>array ;
M: shaped-array pprint* pprint-object ;
M: shaped-array pprint-narrow? drop f ;

View File

@ -8,7 +8,7 @@ PREDICATE: cuda-function-word < word
def>> { [ length 14 = ] [ last \ cuda-invoke eq? ] } 1&& ;
: pprint-cuda-library ( library -- )
[ \ CUDA-LIBRARY: [ text ] pprint-prefix ] when* ;
[ \ \CUDA-LIBRARY: [ text ] pprint-prefix ] when* ;
: pprint-cuda-function ( word quot -- )
[
@ -18,7 +18,7 @@ PREDICATE: cuda-function-word < word
")" text block>
] bi ; inline
M: cuda-function-word definer drop \ CUDA-FUNCTION: \ ; ;
M: cuda-function-word definer drop \ \CUDA-FUNCTION: \ \; ;
M: cuda-function-word definition drop f ;
M: cuda-function-word synopsis*
{

View File

@ -40,7 +40,7 @@ SYNTAX: \DESCRIPTIVE: (:) define-descriptive ;
PREDICATE: descriptive < word
"descriptive-definition" word-prop >boolean ;
M: descriptive definer drop \ DESCRIPTIVE: \ ; ;
M: descriptive definer drop \ \DESCRIPTIVE: \ \; ;
M: descriptive definition
"descriptive-definition" word-prop ;
@ -49,7 +49,7 @@ SYNTAX: \DESCRIPTIVE:: (::) define-descriptive ;
INTERSECTION: descriptive-lambda descriptive lambda-word ;
M: descriptive-lambda definer drop \ DESCRIPTIVE:: \ ; ;
M: descriptive-lambda definer drop \ \DESCRIPTIVE:: \ \; ;
M: descriptive-lambda definition
"lambda" word-prop body>> ;

View File

@ -509,7 +509,7 @@ DEFER: [bind-uniform-tuple]
{ "<" [ scan-word parse-array-def [ first3 uniform boa ] map ] }
{ "{" [
uniform-tuple
\ } parse-until parse-array-def swap prefix
\ \} parse-until parse-array-def swap prefix
[ first3 uniform boa ] map
] }
} case ;

View File

@ -36,6 +36,6 @@ M: number-hash-set clone
: >number-hash-set ( members -- shash-set )
[ <number-wrapper> ] map >hash-set number-hash-set boa ;
SYNTAX: \NHS{ \ } [ >number-hash-set ] parse-literal ;
SYNTAX: \NHS{ \ \} [ >number-hash-set ] parse-literal ;
{ "hash-sets.numbers" "prettyprint" } "hash-sets.numbers.prettyprint" require-when

View File

@ -5,4 +5,4 @@ USING: hash-sets.numbers kernel prettyprint.custom ;
IN: hash-sets.numbers.prettyprint
M: number-hash-set pprint-delims drop \ NHS{ \ } ;
M: number-hash-set pprint-delims drop \ \NHS{ \ \} ;

View File

@ -39,6 +39,6 @@ M: number-hashtable clone
M: number-hashtable new-assoc drop <number-hashtable> ;
SYNTAX: \NH{ \ } [ >number-hashtable ] parse-literal ;
SYNTAX: \NH{ \ \} [ >number-hashtable ] parse-literal ;
{ "hashtables.numbers" "prettyprint" } "hashtables.numbers.prettyprint" require-when

View File

@ -5,4 +5,4 @@ USING: hashtables.numbers kernel prettyprint.custom ;
IN: hashtables.numbers
M: number-hashtable pprint-delims drop \ NH{ \ } ;
M: number-hashtable pprint-delims drop \ \NH{ \ \} ;

View File

@ -254,7 +254,7 @@ INLINE-FUNCTOR: blas-matrix ( type: name t: string u: string c: string -- ) [[
: >${type}-blas-matrix ( arrays -- matrix )
[ ${type} >c-array underlying>> ] (>matrix) <${type}-blas-matrix> ;
SYNTAX: ${t}matrix{ \ } [ >${type}-blas-matrix ] parse-literal ;
SYNTAX: \${t}matrix{ \ \} [ >${type}-blas-matrix ] parse-literal ;
M: ${type}-blas-matrix element-type
drop ${type} ;
@ -275,7 +275,7 @@ INLINE-FUNCTOR: blas-matrix ( type: name t: string u: string c: string -- ) [[
(prepare-ger) [ ${t}GER${c} ] dip ;
M: ${type}-blas-matrix pprint-delims
drop \ ${t}matrix{ \ } ;
drop \ \${t}matrix{ \ \} ;
]]
>>

View File

@ -138,7 +138,7 @@ INLINE-FUNCTOR: blas-vector ( type: name t: string -- ) [[
[ ${type} >c-array underlying>> ] [ length ] bi 1 <${type}-blas-vector> ;
>>
<<
SYNTAX: ${t}vector{ \ } [ >${type}-blas-vector ] parse-literal ;
SYNTAX: \${t}vector{ \ \} [ >${type}-blas-vector ] parse-literal ;
>>
M: ${type}-blas-vector clone
@ -166,7 +166,7 @@ INLINE-FUNCTOR: blas-vector ( type: name t: string -- ) [[
(prepare-scal) [ ${t}SCAL ] dip ;
M: ${type}-blas-vector pprint-delims
drop \ ${t}vector{ \ } ;
drop \ \${t}vector{ \ \} ;
]]
>>

View File

@ -94,6 +94,7 @@ DEFER: lex-factor-nested
dup [ { [ "--" sequence= ] } 1&& ] split-when
dup length 1 > [ nip ] [ drop ] if ;
DEFER: lex-factor-fallthrough
MACRO:: read-matched ( ch -- quot: ( string n tag -- string n' slice' ) )
ch dup matching-delimiter {
[ drop "=" swap prefix ]
@ -107,7 +108,10 @@ MACRO:: read-matched ( ch -- quot: ( string n tag -- string n' slice' ) )
drop dup '[ _ matching-delimiter-string closestr1 2array members lex-until ] dip
swap unclip-last 3array
] } ! ( foo )
[ drop [ slice-til-whitespace drop ] dip span-slices ] ! (foo)
[
drop [ slice-til-whitespace drop ] dip span-slices
dup last lex-factor-fallthrough
] ! (foo) ${foo}stuff{ }
} cond
] ;
@ -396,6 +400,9 @@ DEFER: lex-factor-top*
] unless
] }
{ f [ ] }
! foo{abc}s -- the ``s`` here is fine
! any character that is not special is fine here
[ drop ]
} case ;
! Inside a FOO: or a <FOO FOO>

View File

@ -251,7 +251,7 @@ SYNTAX: \M:
! Definition protocol. We qualify core generics here
QUALIFIED: syntax
syntax:M: generic definer drop \ MULTI-GENERIC: f ;
syntax:M: generic definer drop \ \MULTI-GENERIC: f ;
syntax:M: generic definition drop f ;
@ -277,7 +277,7 @@ syntax:M: method-spec forget*
unclip method forget* ;
syntax:M: method-body definer
drop \ METHOD: \ ; ;
drop \ \METHOD: \ \; ;
syntax:M: method-body synopsis*
dup definer.

View File

@ -16,7 +16,7 @@ PREDICATE: role < mixin-class
scan-new-class scan-token {
{ ";" [ { } { } ] }
{ "<" [ scan-word 1array [ parse-tuple-slots ] { } make ] }
{ "<{" [ \ } parse-until >array [ parse-tuple-slots ] { } make ] }
{ "<{" [ \ \} parse-until >array [ parse-tuple-slots ] { } make ] }
[ { } swap [ parse-slot-name [ parse-tuple-slots ] when ] { } make ]
} case ;

View File

@ -100,7 +100,7 @@ TUPLE: slides < book ;
first3 2 over length [a,b] [ head 3array ] with with with map ;
SYNTAX: \strip-tease{
\ } [ strip-tease ] parse-literal ;
\ \} [ strip-tease ] parse-literal ;
\ slides H{
{ T{ button-down } [ request-focus ] }

View File

@ -162,6 +162,6 @@ M: avl assoc-like
drop dup avl? [ >avl ] unless ;
SYNTAX: \AVL{
\ } [ >avl ] parse-literal ;
\ \} [ >avl ] parse-literal ;
M: avl pprint-delims drop \ AVL{ \ } ;
M: avl pprint-delims drop \ \AVL{ \ \} ;

View File

@ -140,9 +140,9 @@ PRIVATE>
T{ splay f f 0 } assoc-clone-like ;
SYNTAX: \SPLAY{
\ } [ >splay ] parse-literal ;
\ \} [ >splay ] parse-literal ;
M: splay assoc-like
drop dup splay? [ >splay ] unless ;
M: splay pprint-delims drop \ SPLAY{ \ } ;
M: splay pprint-delims drop \ \SPLAY{ \ \} ;

View File

@ -410,14 +410,14 @@ PRIVATE>
T{ tree f f 0 } assoc-clone-like ;
SYNTAX: \TREE{
\ } [ >tree ] parse-literal ;
\ \} [ >tree ] parse-literal ;
<PRIVATE
M: tree assoc-like drop dup tree? [ >tree ] unless ;
M: tree assoc-size count>> ;
M: tree pprint-delims drop \ TREE{ \ } ;
M: tree pprint-delims drop \ \TREE{ \ \} ;
M: tree >pprint-sequence >alist ;
M: tree pprint-narrow? drop t ;