factor: SYNTAX: \foo

modern-harvey2
Doug Coleman 2017-08-26 14:20:04 -05:00
parent 7ca280aee6
commit 147ae66ab5
108 changed files with 221 additions and 221 deletions

View File

@ -29,4 +29,4 @@ M: F-destructor dispose alien>> F N ndrop ;
;FUNCTOR> ;FUNCTOR>
SYNTAX: DESTRUCTOR: scan-word define-destructor ; SYNTAX: \DESTRUCTOR: scan-word define-destructor ;

View File

@ -147,18 +147,18 @@ ERROR: unsupported-endian-type endian slot ;
[ compute-struct-offsets ] [ drop 1 ] [ compute-struct-offsets ] [ drop 1 ]
(define-struct-class) ; (define-struct-class) ;
SYNTAX: LE-STRUCT: SYNTAX: \LE-STRUCT:
parse-struct-definition parse-struct-definition
little-endian define-endian-struct-class ; little-endian define-endian-struct-class ;
SYNTAX: BE-STRUCT: SYNTAX: \BE-STRUCT:
parse-struct-definition parse-struct-definition
big-endian define-endian-struct-class ; big-endian define-endian-struct-class ;
SYNTAX: LE-PACKED-STRUCT: SYNTAX: \LE-PACKED-STRUCT:
parse-struct-definition parse-struct-definition
little-endian define-endian-packed-struct-class ; little-endian define-endian-packed-struct-class ;
SYNTAX: BE-PACKED-STRUCT: SYNTAX: \BE-PACKED-STRUCT:
parse-struct-definition parse-struct-definition
big-endian define-endian-packed-struct-class ; big-endian define-endian-packed-struct-class ;

View File

@ -6,37 +6,37 @@ strings.parser vocabs words ;
<< "alien.arrays" require >> ! needed for bootstrap << "alien.arrays" require >> ! needed for bootstrap
IN: alien.syntax IN: alien.syntax
SYNTAX: DLL" lexer get skip-blank parse-string dlopen suffix! ; SYNTAX: \DLL" lexer get skip-blank parse-string dlopen suffix! ;
SYNTAX: ALIEN: 16 scan-base <alien> suffix! ; SYNTAX: \ALIEN: 16 scan-base <alien> suffix! ;
SYNTAX: BAD-ALIEN <bad-alien> suffix! ; SYNTAX: \BAD-ALIEN <bad-alien> suffix! ;
SYNTAX: LIBRARY: scan-token current-library set ; SYNTAX: \LIBRARY: scan-token current-library set ;
SYNTAX: FUNCTION: SYNTAX: \FUNCTION:
(FUNCTION:) make-function define-inline ; (FUNCTION:) make-function define-inline ;
SYNTAX: FUNCTION-ALIAS: SYNTAX: \FUNCTION-ALIAS:
scan-token create-function scan-token create-function
(FUNCTION:) (make-function) define-inline ; (FUNCTION:) (make-function) define-inline ;
SYNTAX: CALLBACK: SYNTAX: \CALLBACK:
(CALLBACK:) define-inline ; (CALLBACK:) define-inline ;
SYNTAX: TYPEDEF: SYNTAX: \TYPEDEF:
scan-c-type CREATE-C-TYPE dup save-location typedef ; scan-c-type CREATE-C-TYPE dup save-location typedef ;
SYNTAX: ENUM: SYNTAX: \ENUM:
parse-enum (define-enum) ; parse-enum (define-enum) ;
SYNTAX: C-TYPE: SYNTAX: \C-TYPE:
void CREATE-C-TYPE typedef ; void CREATE-C-TYPE typedef ;
SYNTAX: &: SYNTAX: \&:
scan-token current-library get '[ _ _ address-of ] append! ; scan-token current-library get '[ _ _ address-of ] append! ;
SYNTAX: C-GLOBAL: scan-c-type scan-new-word define-global ; SYNTAX: \C-GLOBAL: scan-c-type scan-new-word define-global ;
SYNTAX: pointer: SYNTAX: \pointer:
scan-c-type <pointer> suffix! ; scan-c-type <pointer> suffix! ;

View File

@ -11,6 +11,6 @@ IN: cocoa.apple-script
<NSString> -> initWithSource: -> autorelease <NSString> -> initWithSource: -> autorelease
f -> executeAndReturnError: drop ; f -> executeAndReturnError: drop ;
SYNTAX: APPLESCRIPT: SYNTAX: \APPLESCRIPT:
scan-new-word scan-object scan-new-word scan-object
[ run-apple-script ] curry ( -- ) define-declared ; [ run-apple-script ] curry ( -- ) define-declared ;

View File

@ -16,7 +16,7 @@ SYNTAX: -> scan-token dup remember-send suffix! \ send suffix! ;
SYNTAX: ?-> scan-token dup remember-send suffix! \ ?send suffix! ; SYNTAX: ?-> scan-token dup remember-send suffix! \ ?send suffix! ;
SYNTAX: SEL: SYNTAX: \SEL:
scan-token scan-token
[ remember-send ] [ remember-send ]
[ <selector> suffix! \ cocoa.messages:selector suffix! ] bi ; [ <selector> suffix! \ cocoa.messages:selector suffix! ] bi ;
@ -34,9 +34,9 @@ frameworks [ V{ } clone ] initialize
[ frameworks get [ load-framework ] each ] "cocoa" add-startup-hook [ frameworks get [ load-framework ] each ] "cocoa" add-startup-hook
SYNTAX: FRAMEWORK: scan-token [ load-framework ] [ frameworks get push ] bi ; SYNTAX: \FRAMEWORK: scan-token [ load-framework ] [ frameworks get push ] bi ;
SYNTAX: IMPORT: scan-token [ ] import-objc-class ; SYNTAX: \IMPORT: scan-token [ ] import-objc-class ;
"Importing Cocoa classes..." print "Importing Cocoa classes..." print

View File

@ -71,12 +71,12 @@ IN: cocoa.subclassing
TUPLE: cocoa-protocol name ; TUPLE: cocoa-protocol name ;
C: <cocoa-protocol> cocoa-protocol C: <cocoa-protocol> cocoa-protocol
SYNTAX: COCOA-PROTOCOL: SYNTAX: \COCOA-PROTOCOL:
scan-token <cocoa-protocol> suffix! ; scan-token <cocoa-protocol> suffix! ;
SYMBOL: ;CLASS> SYMBOL: ;CLASS>
SYNTAX: <CLASS: SYNTAX: \<CLASS:
scan-token scan-token
"<" expect "<" expect
scan-token scan-token
@ -101,7 +101,7 @@ SYNTAX: <CLASS:
[ [ make-local ] map ] H{ } make [ [ make-local ] map ] H{ } make
(parse-lambda) <lambda> ?rewrite-closures first ; (parse-lambda) <lambda> ?rewrite-closures first ;
SYNTAX: METHOD: SYNTAX: \METHOD:
scan-c-type scan-c-type
parse-selector parse-selector
parse-method-body [ swap ] 2dip 4array ";" expect parse-method-body [ swap ] 2dip 4array ";" expect

View File

@ -31,4 +31,4 @@ ERROR: no-such-color name ;
: named-color ( name -- color ) : named-color ( name -- color )
dup colors at [ ] [ no-such-color ] ?if ; dup colors at [ ] [ no-such-color ] ?if ;
SYNTAX: color: scan-token named-color suffix! ; SYNTAX: \color: scan-token named-color suffix! ;

View File

@ -18,4 +18,4 @@ IN: colors.hex
[ red>> ] [ green>> ] [ blue>> ] tri [ red>> ] [ green>> ] [ blue>> ] tri
[ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ; [ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ;
SYNTAX: hexcolor: scan-token hex>rgba suffix! ; SYNTAX: \hexcolor: scan-token hex>rgba suffix! ;

View File

@ -133,8 +133,8 @@ INSTANCE: name backward-analysis
PRIVATE> PRIVATE>
SYNTAX: FORWARD-ANALYSIS: SYNTAX: \FORWARD-ANALYSIS:
scan-token [ define-analysis ] [ define-forward-analysis ] bi ; scan-token [ define-analysis ] [ define-forward-analysis ] bi ;
SYNTAX: BACKWARD-ANALYSIS: SYNTAX: \BACKWARD-ANALYSIS:
scan-token [ define-analysis ] [ define-backward-analysis ] bi ; scan-token [ define-analysis ] [ define-backward-analysis ] bi ;

View File

@ -88,14 +88,14 @@ TUPLE: insn-slot-spec type name rep ;
[ nip define-insn-ctor ] [ nip define-insn-ctor ]
} 3cleave ; } 3cleave ;
SYNTAX: INSN: SYNTAX: \INSN:
scan-new-class insn-word ";" parse-tokens define-insn ; scan-new-class insn-word ";" parse-tokens define-insn ;
SYNTAX: VREG-INSN: SYNTAX: \VREG-INSN:
scan-new-class vreg-insn-word ";" parse-tokens define-insn ; scan-new-class vreg-insn-word ";" parse-tokens define-insn ;
SYNTAX: FLUSHABLE-INSN: SYNTAX: \FLUSHABLE-INSN:
scan-new-class flushable-insn-word ";" parse-tokens define-insn ; scan-new-class flushable-insn-word ";" parse-tokens define-insn ;
SYNTAX: FOLDABLE-INSN: SYNTAX: \FOLDABLE-INSN:
scan-new-class foldable-insn-word ";" parse-tokens define-insn ; scan-new-class foldable-insn-word ";" parse-tokens define-insn ;

View File

@ -32,5 +32,5 @@ C: <ds-loc> ds-loc
TUPLE: rs-loc < loc ; TUPLE: rs-loc < loc ;
C: <rs-loc> rs-loc C: <rs-loc> rs-loc
SYNTAX: d: scan-number <ds-loc> suffix! ; SYNTAX: \d: scan-number <ds-loc> suffix! ;
SYNTAX: r: scan-number <rs-loc> suffix! ; SYNTAX: \r: scan-number <rs-loc> suffix! ;

View File

@ -85,4 +85,4 @@ insn-classes get [ insn-temp-slots empty? ] reject [
;FUNCTOR> ;FUNCTOR>
SYNTAX: RENAMING: scan-token scan-object scan-object scan-object define-renaming ; SYNTAX: \RENAMING: scan-token scan-object scan-object scan-object define-renaming ;

View File

@ -117,7 +117,7 @@ M: ##epilogue generate-insn
[ insn-slot-quot ] map cleave>quot [ insn-slot-quot ] map cleave>quot
] dip suffix ; ] dip suffix ;
SYNTAX: CODEGEN: SYNTAX: \CODEGEN:
scan-word [ \ generate-insn create-method-in ] keep scan-word scan-word [ \ generate-insn create-method-in ] keep scan-word
codegen-method-body define ; codegen-method-body define ;
@ -268,7 +268,7 @@ CODEGEN: ##reload %reload
! Conditional branches ! Conditional branches
<< <<
SYNTAX: CONDITIONAL: SYNTAX: \CONDITIONAL:
scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word
codegen-method-body define ; codegen-method-body define ;

View File

@ -98,7 +98,7 @@ FUNCTION: CFStringRef CFCopyTypeIDDescription ( CFTypeID type_id )
: CFType>description ( cf -- description ) : CFType>description ( cf -- description )
CFGetTypeID [ CFCopyTypeIDDescription &CFRelease CF>string ] with-destructors ; CFGetTypeID [ CFCopyTypeIDDescription &CFRelease CF>string ] with-destructors ;
SYNTAX: CFSTRING: SYNTAX: \CFSTRING:
scan-new-word scan-object scan-new-word scan-object
[ drop ] [ '[ _ [ _ <CFString> ] initialize-alien ] ] 2bi [ drop ] [ '[ _ [ _ <CFString> ] initialize-alien ] ] 2bi
( -- alien ) define-declared ; ( -- alien ) define-declared ;

View File

@ -22,8 +22,8 @@ registers [ H{ } clone ] initialize
: define-registers ( names size -- ) : define-registers ( names size -- )
[ [ 0 ] dip (define-registers) ] keep registers get set-at ; [ [ 0 ] dip (define-registers) ] keep registers get set-at ;
SYNTAX: REGISTERS: SYNTAX: \REGISTERS:
scan-number [ ";" parse-tokens ] dip define-registers ; scan-number [ ";" parse-tokens ] dip define-registers ;
SYNTAX: HI-REGISTERS: SYNTAX: \HI-REGISTERS:
scan-number [ ";" parse-tokens 4 ] dip (define-registers) drop ; scan-number [ ";" parse-tokens 4 ] dip (define-registers) drop ;

View File

@ -24,7 +24,7 @@ icons [ H{ } clone ] initialize
define define
] 2bi ; ] 2bi ;
SYNTAX: ICON: scan-word scan-token define-icon ; SYNTAX: \ICON: scan-word scan-token define-icon ;
>> >>

View File

@ -109,11 +109,11 @@ PRIVATE>
: define-consult ( consultation -- ) : define-consult ( consultation -- )
[ register-consult ] [ consult-methods ] bi ; [ register-consult ] [ consult-methods ] bi ;
SYNTAX: CONSULT: SYNTAX: \CONSULT:
scan-word scan-word parse-definition <consultation> scan-word scan-word parse-definition <consultation>
[ save-location ] [ define-consult ] bi ; [ save-location ] [ define-consult ] bi ;
SYNTAX: BROADCAST: SYNTAX: \BROADCAST:
scan-word scan-word parse-definition <broadcast> scan-word scan-word parse-definition <broadcast>
[ save-location ] [ define-consult ] bi ; [ save-location ] [ define-consult ] bi ;
@ -176,7 +176,7 @@ PRIVATE>
[ initialize-protocol-props ] 2tri [ initialize-protocol-props ] 2tri
] 2bi ; ] 2bi ;
SYNTAX: PROTOCOL: SYNTAX: \PROTOCOL:
scan-new-word parse-definition define-protocol ; scan-new-word parse-definition define-protocol ;
PREDICATE: protocol < word protocol-words ; ! Subclass of symbol? PREDICATE: protocol < word protocol-words ; ! Subclass of symbol?
@ -190,7 +190,7 @@ M: protocol definer drop \ PROTOCOL: \ ; ;
M: protocol group-words protocol-words ; M: protocol group-words protocol-words ;
SYNTAX: SLOT-PROTOCOL: SYNTAX: \SLOT-PROTOCOL:
scan-new-word ";" scan-new-word ";"
[ [ reader-word ] [ writer-word ] bi 2array ] [ [ reader-word ] [ writer-word ] bi 2array ]
map-tokens concat define-protocol ; map-tokens concat define-protocol ;

View File

@ -82,7 +82,7 @@ FUNCTOR-SYNTAX: \M:
parse-definition* parse-definition*
\ define* suffix! ; \ define* suffix! ;
FUNCTOR-SYNTAX: C: FUNCTOR-SYNTAX: \C:
scan-param suffix! scan-param suffix!
scan-param [ scan-param [
suffix! suffix!
@ -90,31 +90,31 @@ FUNCTOR-SYNTAX: C:
] keep suffix! \ boa-effect suffix! ] keep suffix! \ boa-effect suffix!
\ define-declared* suffix! ; \ define-declared* suffix! ;
FUNCTOR-SYNTAX: : FUNCTOR-SYNTAX: \:
scan-param suffix! scan-param suffix!
parse-declared* parse-declared*
\ define-declared* suffix! ; \ define-declared* suffix! ;
FUNCTOR-SYNTAX: SYMBOL: FUNCTOR-SYNTAX: \SYMBOL:
scan-param suffix! scan-param suffix!
\ define-symbol suffix! ; \ define-symbol suffix! ;
FUNCTOR-SYNTAX: SYNTAX: FUNCTOR-SYNTAX: \SYNTAX:
scan-param suffix! scan-param suffix!
parse-definition* parse-definition*
\ define-syntax suffix! ; \ define-syntax suffix! ;
FUNCTOR-SYNTAX: INSTANCE: FUNCTOR-SYNTAX: \INSTANCE:
scan-param suffix! scan-param suffix!
scan-param suffix! scan-param suffix!
\ add-mixin-instance suffix! ; \ add-mixin-instance suffix! ;
FUNCTOR-SYNTAX: GENERIC: FUNCTOR-SYNTAX: \GENERIC:
scan-param suffix! scan-param suffix!
scan-effect suffix! scan-effect suffix!
\ define-simple-generic* suffix! ; \ define-simple-generic* suffix! ;
FUNCTOR-SYNTAX: MACRO: FUNCTOR-SYNTAX: \MACRO:
scan-param suffix! scan-param suffix!
parse-declared* parse-declared*
\ define-macro suffix! ; \ define-macro suffix! ;

View File

@ -53,17 +53,17 @@ M: gir-not-found summary
PRIVATE> PRIVATE>
SYNTAX: GIR: scan-token define-gir-vocab ; SYNTAX: \GIR: scan-token define-gir-vocab ;
SYNTAX: IMPLEMENT-STRUCTS: SYNTAX: \IMPLEMENT-STRUCTS:
";" parse-tokens ";" parse-tokens
implement-structs [ swap append! ] change-global ; implement-structs [ swap append! ] change-global ;
SYNTAX: FOREIGN-ATOMIC-TYPE: SYNTAX: \FOREIGN-ATOMIC-TYPE:
scan-token scan-object swap register-atomic-type ; scan-token scan-object swap register-atomic-type ;
SYNTAX: FOREIGN-ENUM-TYPE: SYNTAX: \FOREIGN-ENUM-TYPE:
scan-token scan-object swap register-enum-type ; scan-token scan-object swap register-enum-type ;
SYNTAX: FOREIGN-RECORD-TYPE: SYNTAX: \FOREIGN-RECORD-TYPE:
scan-token scan-object swap register-record-type ; scan-token scan-object swap register-record-type ;

View File

@ -41,7 +41,7 @@ M: identity-hashtable assoc-like
M: identity-hashtable new-assoc drop <identity-hashtable> ; M: identity-hashtable new-assoc drop <identity-hashtable> ;
SYNTAX: IH{ \ } [ >identity-hashtable ] parse-literal ; SYNTAX: \IH{ \ } [ >identity-hashtable ] parse-literal ;
{ "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when { "hashtables.identity" "prettyprint" } "hashtables.identity.prettyprint" require-when
{ "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when { "hashtables.identity" "mirrors" } "hashtables.identity.mirrors" require-when

View File

@ -38,6 +38,6 @@ M: sequence-hashtable clone
M: sequence-hashtable new-assoc drop <sequence-hashtable> ; 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 { "hashtables.sequences" "prettyprint" } "hashtables.sequences.prettyprint" require-when

View File

@ -4,7 +4,7 @@ USING: accessors arrays compiler.units definitions help
help.topics kernel math parser sequences vocabs.parser words ; help.topics kernel math parser sequences vocabs.parser words ;
IN: help.syntax IN: help.syntax
SYNTAX: HELP: SYNTAX: \HELP:
scan-word bootstrap-word scan-word bootstrap-word
[ >link save-location ] [ >link save-location ]
[ [ parse-array-def ] dip set-word-help ] [ [ parse-array-def ] dip set-word-help ]
@ -12,7 +12,7 @@ SYNTAX: HELP:
ERROR: article-expects-name-and-title got ; ERROR: article-expects-name-and-title got ;
SYNTAX: ARTICLE: SYNTAX: \ARTICLE:
location [ location [
parse-array-def parse-array-def
dup length 2 < [ article-expects-name-and-title ] when dup length 2 < [ article-expects-name-and-title ] when
@ -20,5 +20,5 @@ SYNTAX: ARTICLE:
over add-article >link over add-article >link
] dip remember-definition ; ] dip remember-definition ;
SYNTAX: ABOUT: SYNTAX: \ABOUT:
current-vocab scan-object >>help changed-definition ; current-vocab scan-object >>help changed-definition ;

View File

@ -21,7 +21,7 @@ M: tip set-where loc<< ;
: add-tip ( tip -- ) tips get push ; : add-tip ( tip -- ) tips get push ;
SYNTAX: TIP: SYNTAX: \TIP:
parse-array-def <tip> parse-array-def <tip>
[ save-location ] [ add-tip ] bi ; [ save-location ] [ add-tip ] bi ;

View File

@ -73,7 +73,7 @@ ERROR: cannot-specialize word specializer ;
over inline-recursive? [ cannot-specialize ] when over inline-recursive? [ cannot-specialize ] when
"specializer" set-word-prop ; "specializer" set-word-prop ;
SYNTAX: HINTS: SYNTAX: \HINTS:
scan-object dup wrapper? [ wrapped>> ] when scan-object dup wrapper? [ wrapped>> ] when
[ changed-definition ] [ changed-definition ]
[ subwords [ changed-definition ] each ] [ subwords [ changed-definition ] each ]

View File

@ -31,7 +31,7 @@ M: tuple-class component-tag ( tag class -- )
[ compile-component-attrs ] 2bi [ compile-component-attrs ] 2bi
render-quot [code] ; render-quot [code] ;
SYNTAX: COMPONENT: SYNTAX: \COMPONENT:
scan-word scan-word
[ name>> ] [ '[ _ component-tag ] ] bi [ name>> ] [ '[ _ component-tag ] ] bi
define-chloe-tag ; define-chloe-tag ;

View File

@ -13,7 +13,7 @@ tags [ H{ } clone ] initialize
: define-chloe-tag ( name quot -- ) swap tags get set-at ; : define-chloe-tag ( name quot -- ) swap tags get set-at ;
SYNTAX: CHLOE: SYNTAX: \CHLOE:
scan-token parse-definition define-chloe-tag ; scan-token parse-definition define-chloe-tag ;
CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0" CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0"

View File

@ -54,4 +54,4 @@ M: 8-bit-encoding <decoder>
PRIVATE> PRIVATE>
SYNTAX: 8-BIT: scan-token scan-token scan-token load-encoding ; SYNTAX: \8-BIT: scan-token scan-token scan-token load-encoding ;

View File

@ -63,6 +63,6 @@ SYMBOL: euc-table
PRIVATE> PRIVATE>
SYNTAX: EUC: SYNTAX: \EUC:
! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt" ! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt"
scan-new-class scan-object define-euc ; scan-new-class scan-object define-euc ;

View File

@ -13,15 +13,15 @@ SYNTAX: [| parse-lambda append! ;
SYNTAX: [let parse-let append! ; SYNTAX: [let parse-let append! ;
SYNTAX: :: (::) define-declared ; SYNTAX: \:: (::) define-declared ;
SYNTAX: M:: (M::) define ; SYNTAX: \M:: (M::) define ;
SYNTAX: MACRO:: (::) define-macro ; SYNTAX: \MACRO:: (::) define-macro ;
SYNTAX: MEMO:: (::) define-memoized ; SYNTAX: \MEMO:: (::) define-memoized ;
SYNTAX: IDENTITY-MEMO:: (::) define-identity-memoized ; SYNTAX: \IDENTITY-MEMO:: (::) define-identity-memoized ;
{ {
"locals.macros" "locals.macros"

View File

@ -137,7 +137,7 @@ PRIVATE>
[ [ input-logging-quot ] 2keep drop error-logging-quot ] [ [ input-logging-quot ] 2keep drop error-logging-quot ]
(define-logging) ; (define-logging) ;
SYNTAX: LOG: SYNTAX: \LOG:
! Syntax: name level ! Syntax: name level
scan-new-word dup scan-word scan-new-word dup scan-word
'[ 1array stack>message _ _ log-message ] '[ 1array stack>message _ _ log-message ]

View File

@ -27,7 +27,7 @@ PRIVATE>
[ 2drop changed-effect ] [ 2drop changed-effect ]
} 3cleave ; } 3cleave ;
SYNTAX: MACRO: (:) define-macro ; SYNTAX: \MACRO: (:) define-macro ;
PREDICATE: macro < word "macro" word-prop >boolean ; PREDICATE: macro < word "macro" word-prop >boolean ;

View File

@ -17,7 +17,7 @@ SYMBOL: _
: define-match-vars ( seq -- ) : define-match-vars ( seq -- )
[ define-match-var ] each ; [ define-match-var ] each ;
SYNTAX: MATCH-VARS: ! vars ... SYNTAX: \MATCH-VARS: ! vars ...
";" [ define-match-var ] each-token ; ";" [ define-match-var ] each-token ;
PREDICATE: match-var < word "match-var" word-prop ; PREDICATE: match-var < word "match-var" word-prop ;

View File

@ -40,7 +40,7 @@ ERROR: malformed-complex obj ;
: parse-complex ( seq -- complex ) : parse-complex ( seq -- complex )
dup length 2 = [ first2-unsafe rect> ] [ malformed-complex ] if ; dup length 2 = [ first2-unsafe rect> ] [ malformed-complex ] if ;
SYNTAX: C{ \ } [ parse-complex ] parse-literal ; SYNTAX: \C{ \ } [ parse-complex ] parse-literal ;
USE: prettyprint.custom USE: prettyprint.custom

View File

@ -5,7 +5,7 @@ IN: math.rectangles.prettyprint
M: rect pprint* M: rect pprint*
[ [
\ RECT: [ \ rect: [
[ loc>> ] [ dim>> ] bi [ pprint* ] bi@ [ loc>> ] [ dim>> ] bi [ pprint* ] bi@
] pprint-prefix ] pprint-prefix
] check-recursion ; ] check-recursion ;

View File

@ -2,39 +2,39 @@ USING: tools.test math.rectangles prettyprint io.streams.string
kernel accessors ; kernel accessors ;
IN: math.rectangles.tests IN: math.rectangles.tests
{ RECT: { 10 10 } { 20 20 } } { rect: { 10 10 } { 20 20 } }
[ [
RECT: { 10 10 } { 50 50 } rect: { 10 10 } { 50 50 }
RECT: { -10 -10 } { 40 40 } rect: { -10 -10 } { 40 40 }
rect-intersect rect-intersect
] unit-test ] unit-test
{ RECT: { 200 200 } { 0 0 } } { rect: { 200 200 } { 0 0 } }
[ [
RECT: { 100 100 } { 50 50 } rect: { 100 100 } { 50 50 }
RECT: { 200 200 } { 40 40 } rect: { 200 200 } { 40 40 }
rect-intersect rect-intersect
] unit-test ] unit-test
{ f } [ { f } [
RECT: { 100 100 } { 50 50 } rect: { 100 100 } { 50 50 }
RECT: { 200 200 } { 40 40 } rect: { 200 200 } { 40 40 }
contains-rect? contains-rect?
] unit-test ] unit-test
{ t } [ { t } [
RECT: { 100 100 } { 50 50 } rect: { 100 100 } { 50 50 }
RECT: { 120 120 } { 40 40 } rect: { 120 120 } { 40 40 }
contains-rect? contains-rect?
] unit-test ] unit-test
{ f } [ { f } [
RECT: { 1000 100 } { 50 50 } rect: { 1000 100 } { 50 50 }
RECT: { 120 120 } { 40 40 } rect: { 120 120 } { 40 40 }
contains-rect? contains-rect?
] unit-test ] unit-test
{ RECT: { 10 20 } { 20 20 } } [ { rect: { 10 20 } { 20 20 } } [
{ {
{ 20 20 } { 20 20 }
{ 10 40 } { 10 40 }
@ -42,5 +42,5 @@ IN: math.rectangles.tests
} rect-containing } rect-containing
] unit-test ] unit-test
! Prettyprint for RECT: didn't do nesting check properly ! Prettyprint for rect: didn't do nesting check properly
{ } [ [ RECT: f f dup >>dim . ] with-string-writer drop ] unit-test { } [ [ rect: f f dup >>dim . ] with-string-writer drop ] unit-test

View File

@ -8,7 +8,7 @@ TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
: <rect> ( loc dim -- rect ) rect boa ; inline : <rect> ( loc dim -- rect ) rect boa ; inline
SYNTAX: RECT: scan-object scan-object <rect> suffix! ; SYNTAX: \rect: scan-object scan-object <rect> suffix! ;
: <zero-rect> ( -- rect ) rect new ; inline : <zero-rect> ( -- rect ) rect new ; inline

View File

@ -78,7 +78,7 @@ SYNTAX: A{ \ } [ >A ] parse-literal ;
[ define-specialized-cord ] [ define-specialized-cord ]
[ create-word-in (define-simd-128-cord) ] 2bi ; [ create-word-in (define-simd-128-cord) ] 2bi ;
SYNTAX: SIMD-128-CORD: SYNTAX: \SIMD-128-CORD:
scan-word scan-token define-simd-128-cord ; scan-word scan-token define-simd-128-cord ;
PRIVATE> PRIVATE>

View File

@ -331,7 +331,7 @@ c:<c-type>
;FUNCTOR> ;FUNCTOR>
SYNTAX: SIMD-128: SYNTAX: \SIMD-128:
scan-token define-simd-128 ; scan-token define-simd-128 ;
PRIVATE> PRIVATE>

View File

@ -69,9 +69,9 @@ PRIVATE>
dup in>> length zero? [ f 1array ] [ IH{ } clone ] if dup in>> length zero? [ f 1array ] [ IH{ } clone ] if
(define-memoized) ; (define-memoized) ;
SYNTAX: MEMO: (:) define-memoized ; SYNTAX: \MEMO: (:) define-memoized ;
SYNTAX: IDENTITY-MEMO: (:) define-identity-memoized ; SYNTAX: \IDENTITY-MEMO: (:) define-identity-memoized ;
PREDICATE: memoized < word "memoize" word-prop >boolean ; PREDICATE: memoized < word "memoize" word-prop >boolean ;

View File

@ -73,7 +73,7 @@ xyz
/* /*
<< <<
SYNTAX: MULTILINE-LITERAL: parse-here suffix! ; SYNTAX: \MULTILINE-LITERAL: parse-here suffix! ;
>> >>
{ { "bar" } } { { "bar" } }

View File

@ -49,7 +49,7 @@ reset-gl-function-number-counter
: gl-function-calling-convention ( -- symbol ) : gl-function-calling-convention ( -- symbol )
os windows? [ stdcall ] [ cdecl ] if ; os windows? [ stdcall ] [ cdecl ] if ;
SYNTAX: GL-FUNCTION: SYNTAX: \GL-FUNCTION:
gl-function-calling-convention gl-function-calling-convention
scan-function-name scan-function-name
"{" expect "}" parse-tokens over suffix "{" expect "}" parse-tokens over suffix

View File

@ -537,7 +537,7 @@ ERROR: could-not-parse-ebnf ;
PRIVATE> PRIVATE>
SYNTAX: EBNF: SYNTAX: \EBNF:
reset-tokenizer reset-tokenizer
scan-new-word dup scan-object scan-new-word dup scan-object
ebnf>quot swapd ebnf>quot swapd
@ -549,13 +549,13 @@ SYNTAX: EBNF:
ebnf>quot nip ebnf>quot nip
suffix! \ call suffix! reset-tokenizer ; suffix! \ call suffix! reset-tokenizer ;
SYNTAX: EBNF[[ "]]" parse-multiline-string define-inline-ebnf ; SYNTAX: \EBNF[[ "]]" parse-multiline-string define-inline-ebnf ;
SYNTAX: EBNF[=[ "]=]" parse-multiline-string define-inline-ebnf ; SYNTAX: \EBNF[=[ "]=]" parse-multiline-string define-inline-ebnf ;
SYNTAX: EBNF[==[ "]==]" parse-multiline-string define-inline-ebnf ; SYNTAX: \EBNF[==[ "]==]" parse-multiline-string define-inline-ebnf ;
SYNTAX: EBNF[===[ "]===]" parse-multiline-string define-inline-ebnf ; SYNTAX: \EBNF[===[ "]===]" parse-multiline-string define-inline-ebnf ;
SYNTAX: EBNF[====[ "]====]" parse-multiline-string define-inline-ebnf ; SYNTAX: \EBNF[====[ "]====]" parse-multiline-string define-inline-ebnf ;
SYNTAX: EBNF-PARSER: SYNTAX: \EBNF-PARSER:
reset-tokenizer reset-tokenizer
scan-new-word scan-new-word
scan-object parse-ebnf main of '[ _ ] scan-object parse-ebnf main of '[ _ ]

View File

@ -607,7 +607,7 @@ PRIVATE>
ERROR: parse-failed input word ; ERROR: parse-failed input word ;
SYNTAX: PEG: SYNTAX: \PEG:
[let [let
(:) :> ( word def effect ) (:) :> ( word def effect )
[ [

View File

@ -53,7 +53,7 @@ M: persistent-hash hashcode* nip assoc-size ;
M: persistent-hash clone ; 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-sequence >alist ;

View File

@ -181,7 +181,7 @@ M: persistent-vector equal?
: >persistent-vector ( seq -- pvec ) : >persistent-vector ( seq -- pvec )
T{ persistent-vector } like ; 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-sequence ;

View File

@ -17,5 +17,5 @@ TUPLE: promise quot forced? value ;
: make-lazy-quot ( quot effect -- quot ) : make-lazy-quot ( quot effect -- quot )
in>> length '[ _ _ ncurry <promise> ] ; in>> length '[ _ _ ncurry <promise> ] ;
SYNTAX: LAZY: SYNTAX: \LAZY:
(:) [ make-lazy-quot ] keep define-declared ; (:) [ make-lazy-quot ] keep define-declared ;

View File

@ -56,7 +56,7 @@ PRIVATE>
<< <<
SYNTAX: ROMAN-OP: SYNTAX: \ROMAN-OP:
scan-word [ name>> "roman" prepend create-word-in ] keep scan-word [ name>> "roman" prepend create-word-in ] keep
1quotation '[ _ binary-roman-op ] 1quotation '[ _ binary-roman-op ]
scan-effect define-declared ; scan-effect define-declared ;
@ -69,4 +69,4 @@ ROMAN-OP: * ( x y -- z )
ROMAN-OP: /i ( x y -- z ) ROMAN-OP: /i ( x y -- z )
ROMAN-OP: /mod ( x y -- z w ) ROMAN-OP: /mod ( x y -- z w )
SYNTAX: ROMAN: scan-token roman> suffix! ; SYNTAX: \ROMAN: scan-token roman> suffix! ;

View File

@ -128,7 +128,7 @@ MACRO: <experiment> ( word -- quot )
<< <<
SYNTAX: TEST: SYNTAX: \TEST:
scan-token scan-token
[ create-word-in ] [ create-word-in ]
[ "(" ")" surround search '[ _ parse-test ] ] bi [ "(" ")" surround search '[ _ parse-test ] ] bi

View File

@ -169,6 +169,6 @@ IN: syntax
SYNTAX: B \ break suffix! ; SYNTAX: B \ break suffix! ;
SYNTAX: B: scan-word definition SYNTAX: \b: scan-word definition
[ break "now press O I to land inside the parsing word" drop ] [ break "now press O I to land inside the parsing word" drop ]
prepose call( accum -- accum ) ; prepose call( accum -- accum ) ;

View File

@ -41,7 +41,7 @@ M: bad-tr summary
PRIVATE> PRIVATE>
SYNTAX: TR: SYNTAX: \TR:
scan-token parse-definition scan-token parse-definition
unclip-last [ unclip-last ] dip compute-tr unclip-last [ unclip-last ] dip compute-tr
[ check-tr ] [ check-tr ]

View File

@ -160,9 +160,9 @@ PRIVATE>
[ drop "typed-def" set-word-prop ] [ drop "typed-def" set-word-prop ]
[ 2drop "typed-word" word-prop set-last-word ] 3tri ; [ 2drop "typed-word" word-prop set-last-word ] 3tri ;
SYNTAX: TYPED: SYNTAX: \TYPED:
(:) define-typed ; (:) define-typed ;
SYNTAX: TYPED:: SYNTAX: \TYPED::
(::) define-typed ; (::) define-typed ;
USE: vocabs.loader USE: vocabs.loader

View File

@ -3,5 +3,5 @@
USING: ui.gadgets prettyprint.backend prettyprint.custom ; USING: ui.gadgets prettyprint.backend prettyprint.custom ;
IN: ui.gadgets.prettyprint IN: ui.gadgets.prettyprint
! Don't print gadgets with RECT: syntax ! Don't print gadgets with rect: syntax
M: gadget pprint* pprint-tuple ; M: gadget pprint* pprint-tuple ;

View File

@ -229,13 +229,13 @@ HOOK: system-alert ui-backend ( caption text -- )
: define-window ( word attributes quot -- ) : define-window ( word attributes quot -- )
'[ [ f _ clone @ open-window ] with-ui ] ( -- ) define-declared ; '[ [ f _ clone @ open-window ] with-ui ] ( -- ) define-declared ;
SYNTAX: WINDOW: SYNTAX: \WINDOW:
scan-new-word scan-new-word
world-attributes parse-window-attributes world-attributes parse-window-attributes
parse-definition parse-definition
define-window ; define-window ;
SYNTAX: MAIN-WINDOW: SYNTAX: \MAIN-WINDOW:
scan-new-word scan-new-word
world-attributes parse-window-attributes world-attributes parse-window-attributes
parse-definition parse-definition

View File

@ -29,6 +29,6 @@ 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
PRIVATE> PRIVATE>
SYNTAX: CATEGORY: parse-category define-category ; SYNTAX: \CATEGORY: parse-category define-category ;
SYNTAX: CATEGORY-NOT: parse-category define-not-category ; SYNTAX: \CATEGORY-NOT: parse-category define-not-category ;

View File

@ -50,7 +50,7 @@ M: vlist like
INSTANCE: vlist immutable-sequence INSTANCE: vlist immutable-sequence
SYNTAX: VL{ \ } [ >vlist ] parse-literal ; SYNTAX: \VL{ \ } [ >vlist ] parse-literal ;
M: vlist pprint-delims drop \ VL{ \ } ; M: vlist pprint-delims drop \ VL{ \ } ;
M: vlist >pprint-sequence ; M: vlist >pprint-sequence ;

View File

@ -82,7 +82,7 @@ ERROR: no-com-interface interface ;
PRIVATE> PRIVATE>
SYNTAX: COM-INTERFACE: SYNTAX: \COM-INTERFACE:
CREATE-C-TYPE CREATE-C-TYPE
void* over typedef void* over typedef
scan-object find-com-interface-definition scan-object find-com-interface-definition
@ -92,7 +92,7 @@ SYNTAX: COM-INTERFACE:
dup save-com-interface-definition dup save-com-interface-definition
define-words-for-com-interface ; define-words-for-com-interface ;
SYNTAX: GUID: scan-token string>guid suffix! ; SYNTAX: \GUID: scan-token string>guid suffix! ;
USE: vocabs.loader USE: vocabs.loader

View File

@ -3,7 +3,7 @@
USING: alien.syntax alien.parser words x11.io sequences kernel ; USING: alien.syntax alien.parser words x11.io sequences kernel ;
IN: x11.syntax IN: x11.syntax
SYNTAX: X-FUNCTION: SYNTAX: \X-FUNCTION:
(FUNCTION:) make-function (FUNCTION:) make-function
[ \ awaken-event-loop suffix ] dip [ \ awaken-event-loop suffix ] dip
define-declared ; define-declared ;

View File

@ -25,7 +25,7 @@ PREDICATE: generated-xml-error < tuple class-of "xml-error-class" word-prop ;
] ]
} 3cleave ; } 3cleave ;
SYNTAX: XML-ERROR: SYNTAX: \XML-ERROR:
parse-tuple-definition pick save-location parse-tuple-definition pick save-location
define-xml-error-class ; define-xml-error-class ;

View File

@ -27,16 +27,16 @@ M: no-tag summary
PRIVATE> PRIVATE>
SYNTAX: TAGS: SYNTAX: \TAGS:
scan-new-word scan-effect scan-new-word scan-effect
[ drop H{ } clone "xtable" set-word-prop ] [ drop H{ } clone "xtable" set-word-prop ]
[ define-tags ] [ define-tags ]
2bi ; 2bi ;
SYNTAX: TAG: SYNTAX: \TAG:
scan-token scan-word parse-definition define-tag ; scan-token scan-word parse-definition define-tag ;
SYNTAX: XML-NS: SYNTAX: \XML-NS:
scan-new-word scan-token '[ f swap _ <name> ] ( string -- name ) define-memoized ; scan-new-word scan-token '[ f swap _ <name> ] ( string -- name ) define-memoized ;
<PRIVATE <PRIVATE

View File

@ -10,7 +10,7 @@ IN: xmode.loader.syntax
: (parse-rule-tag) ( rule-set tag specs class -- ) : (parse-rule-tag) ( rule-set tag specs class -- )
new swap init-from-tag swap add-rule ; inline new swap init-from-tag swap add-rule ; inline
SYNTAX: RULE: SYNTAX: \RULE:
scan-token scan-word scan-word [ scan-token scan-word scan-word [
[ parse-definition call( -- ) ] { } make [ parse-definition call( -- ) ] { } make
swap [ (parse-rule-tag) ] 2curry swap [ (parse-rule-tag) ] 2curry

View File

@ -123,8 +123,8 @@ MACRO: data-map! ( ins outs -- quot )
PRIVATE> PRIVATE>
SYNTAX: data-map( SYNTAX: \data-map(
parse-data-map-effect \ data-map suffix! ; parse-data-map-effect \ data-map suffix! ;
SYNTAX: data-map!( SYNTAX: \data-map!(
parse-data-map-effect \ data-map! suffix! ; parse-data-map-effect \ data-map! suffix! ;

View File

@ -440,15 +440,15 @@ MACRO: fortran-invoke ( return library function parameters -- quot )
return library function parameters return [ c:void ] unless* parse-arglist return library function parameters return [ c:void ] unless* parse-arglist
[ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ; [ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ;
SYNTAX: SUBROUTINE: SYNTAX: \SUBROUTINE:
f current-library get scan-token ")" parse-tokens f current-library get scan-token ")" parse-tokens
[ "()" subseq? ] reject define-fortran-function ; [ "()" subseq? ] reject define-fortran-function ;
SYNTAX: FUNCTION: SYNTAX: \FUNCTION:
scan-token current-library get scan-token ")" parse-tokens scan-token current-library get scan-token ")" parse-tokens
[ "()" subseq? ] reject define-fortran-function ; [ "()" subseq? ] reject define-fortran-function ;
SYNTAX: LIBRARY: SYNTAX: \LIBRARY:
scan-token scan-token
[ current-library set ] [ current-library set ]
[ set-fortran-abi ] bi ; [ set-fortran-abi ] bi ;

View File

@ -192,7 +192,7 @@ TUPLE: row-traverser shaped-array index ;
GENERIC: next-index ( object -- 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: row-array pprint* shaped-array>array pprint* ;
! M: col-array pprint* shaped-array>array flip pprint* ; ! M: col-array pprint* shaped-array>array flip pprint* ;

View File

@ -7,14 +7,14 @@ IN: calendar.holidays
SINGLETONS: all world commonwealth-of-nations ; SINGLETONS: all world commonwealth-of-nations ;
<< <<
SYNTAX: HOLIDAY: SYNTAX: \HOLIDAY:
scan-new-word scan-new-word
dup "holiday" word-prop [ dup "holiday" word-prop [
dup H{ } clone "holiday" set-word-prop dup H{ } clone "holiday" set-word-prop
] unless ] unless
parse-definition ( timestamp/n -- timestamp ) define-declared ; parse-definition ( timestamp/n -- timestamp ) define-declared ;
SYNTAX: HOLIDAY-NAME: SYNTAX: \HOLIDAY-NAME:
[let scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value [let scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value
value name holidays set-at ] ; value name holidays set-at ] ;
>> >>

View File

@ -8,4 +8,4 @@ MACRO: inline-changer ( name -- quot' )
[ "accessors" lookup-word 1quotation ] bi@ [ "accessors" lookup-word 1quotation ] bi@
'[ over [ [ @ ] dip call ] dip swap @ ] ; '[ over [ [ @ ] dip call ] dip swap @ ] ;
SYNTAX: change: scan-token '[ _ inline-changer ] append! ; SYNTAX: \change: scan-token '[ _ inline-changer ] append! ;

View File

@ -113,5 +113,5 @@ M: T-array struct-transpose
;FUNCTOR> ;FUNCTOR>
SYNTAX: VECTORED-STRUCT: SYNTAX: \VECTORED-STRUCT:
scan-word define-vectored-struct ; scan-word define-vectored-struct ;

View File

@ -32,4 +32,4 @@ PRIVATE>
: flex-hex>rgba ( str -- rgba ) : flex-hex>rgba ( str -- rgba )
flex-hex hex>rgba ; flex-hex hex>rgba ;
SYNTAX: flexhexcolor: scan-token flex-hex>rgba suffix! ; SYNTAX: \flexhexcolor: scan-token flex-hex>rgba suffix! ;

View File

@ -47,7 +47,7 @@ ERROR: unknown-constructor-parameters class effect unknown ;
scan-constructor scan-effect ensure-constructor-parameters scan-constructor scan-effect ensure-constructor-parameters
parse-definition ; parse-definition ;
SYNTAX: CONSTRUCTOR: SYNTAX: \CONSTRUCTOR:
parse-constructor parse-constructor
[ [ constructor-boa-quot ] dip compose ] [ [ constructor-boa-quot ] dip compose ]
[ drop ] 2bi define-declared ; [ drop ] 2bi define-declared ;
@ -59,6 +59,6 @@ SYNTAX: CONSTRUCTOR:
: scan-full-input-effect ( -- effect ) : scan-full-input-effect ( -- effect )
"(" expect scan-rest-input-effect ; "(" expect scan-rest-input-effect ;
SYNTAX: SLOT-CONSTRUCTOR: SYNTAX: \SLOT-CONSTRUCTOR:
scan-new-word [ name>> "(" append create-reset ] keep scan-new-word [ name>> "(" append create-reset ] keep
'[ scan-rest-input-effect in>> _ '[ _ _ slots>boa ] append! ] define-syntax ; '[ scan-rest-input-effect in>> _ '[ _ _ slots>boa ] append! ] define-syntax ;

View File

@ -1381,13 +1381,13 @@ SYMBOL: last-opcode
dup last-instruction set-global dup last-instruction set-global
] dip ( cpu -- ) define-declared ; ] dip ( cpu -- ) define-declared ;
SYNTAX: INSTRUCTION: ";" parse-tokens parse-instructions ; SYNTAX: \INSTRUCTION: ";" parse-tokens parse-instructions ;
SYNTAX: cycles: SYNTAX: \cycles:
! Set the number of cycles for the last instruction that was defined. ! Set the number of cycles for the last instruction that was defined.
scan-token string>number last-opcode get-global instruction-cycles set-nth ; scan-token string>number last-opcode get-global instruction-cycles set-nth ;
SYNTAX: opcode: SYNTAX: \opcode:
! Set the opcode number for the last instruction that was defined. ! Set the opcode number for the last instruction that was defined.
last-instruction get-global 1quotation scan-token hex> last-instruction get-global 1quotation scan-token hex>
dup last-opcode set-global set-instruction ; dup last-opcode set-global set-instruction ;

View File

@ -11,7 +11,7 @@ SYMBOL: registers
V{ } registers set-global V{ } registers set-global
SYNTAX: REGISTER: SYNTAX: \REGISTER:
scan-new-word scan-new-word
[ define-symbol ] [ define-symbol ]
[ registers get length "register" set-word-prop ] [ registers get length "register" set-word-prop ]

View File

@ -4,15 +4,15 @@ USING: alien.parser cuda.libraries fry kernel lexer namespaces
parser ; parser ;
IN: cuda.syntax IN: cuda.syntax
SYNTAX: CUDA-LIBRARY: SYNTAX: \CUDA-LIBRARY:
scan-token scan-word scan-object scan-token scan-word scan-object
'[ _ _ add-cuda-library ] '[ _ _ add-cuda-library ]
[ current-cuda-library set-global ] bi ; [ current-cuda-library set-global ] bi ;
SYNTAX: CUDA-FUNCTION: SYNTAX: \CUDA-FUNCTION:
scan-token [ create-word-in current-cuda-library get ] keep scan-token [ create-word-in current-cuda-library get ] keep
scan-c-args define-cuda-function ; scan-c-args define-cuda-function ;
SYNTAX: CUDA-GLOBAL: SYNTAX: \CUDA-GLOBAL:
scan-token [ create-word-in current-cuda-library get ] keep scan-token [ create-word-in current-cuda-library get ] keep
define-cuda-global ; define-cuda-global ;

View File

@ -19,7 +19,7 @@ C: <decimal> decimal
: parse-decimal ( -- decimal ) scan-token string>decimal ; : parse-decimal ( -- decimal ) scan-token string>decimal ;
SYNTAX: decimal: parse-decimal suffix! ; SYNTAX: \decimal: parse-decimal suffix! ;
: decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ; : decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ;

View File

@ -35,7 +35,7 @@ PRIVATE>
[ [ [ dup ] 2dip [descriptive] ] keep define-declared ] [ [ [ dup ] 2dip [descriptive] ] keep define-declared ]
3bi ; 3bi ;
SYNTAX: DESCRIPTIVE: (:) define-descriptive ; SYNTAX: \DESCRIPTIVE: (:) define-descriptive ;
PREDICATE: descriptive < word PREDICATE: descriptive < word
"descriptive-definition" word-prop >boolean ; "descriptive-definition" word-prop >boolean ;
@ -45,7 +45,7 @@ M: descriptive definer drop \ DESCRIPTIVE: \ ; ;
M: descriptive definition M: descriptive definition
"descriptive-definition" word-prop ; "descriptive-definition" word-prop ;
SYNTAX: DESCRIPTIVE:: (::) define-descriptive ; SYNTAX: \DESCRIPTIVE:: (::) define-descriptive ;
INTERSECTION: descriptive-lambda descriptive lambda-word ; INTERSECTION: descriptive-lambda descriptive lambda-word ;

View File

@ -26,4 +26,4 @@ IN: dice
'[ _ _ random-roll ] '[ _ _ random-roll ]
] if* ; ] if* ;
SYNTAX: ROLL: scan-token roll-quot append! ; SYNTAX: \ROLL: scan-token roll-quot append! ;

View File

@ -79,7 +79,7 @@ M: game-world apply-world-attributes
: define-attributes-word ( word tuple -- ) : define-attributes-word ( word tuple -- )
[ name>> "-attributes" append create-word-in ] dip define-constant ; [ name>> "-attributes" append create-word-in ] dip define-constant ;
SYNTAX: GAME: SYNTAX: \GAME:
scan-new-word scan-new-word
game-attributes parse-window-attributes game-attributes parse-window-attributes
2dup define-attributes-word 2dup define-attributes-word

View File

@ -27,7 +27,7 @@ SYMBOL: current-macro
MACRO:: log-euler-op ( class def inputs -- quot ) MACRO:: log-euler-op ( class def inputs -- quot )
class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ; class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ;
SYNTAX: LOG-GML: SYNTAX: \LOG-GML:
[let [let
(GML:) :> ( word name effect def ) (GML:) :> ( word name effect def )

View File

@ -37,9 +37,9 @@ FROM: kernel.private => declare ;
scan-word \ (exec) create-method-in scan-word \ (exec) create-method-in
swap call( -- quot ) [ is-gml ] prepend ; swap call( -- quot ) [ is-gml ] prepend ;
SYNTAX: EXEC: [ parse-definition ] (EXEC:) define ; SYNTAX: \EXEC: [ parse-definition ] (EXEC:) define ;
SYNTAX: EXEC:: [ [ parse-definition ] parse-locals-definition drop ] (EXEC:) define ; SYNTAX: \EXEC:: [ [ parse-definition ] parse-locals-definition drop ] (EXEC:) define ;
>> >>
@ -53,7 +53,7 @@ TUPLE: gml-exec-name < identity-tuple name ;
MEMO: >gml-exec-name ( string -- name ) >gml-name \ gml-exec-name boa ; MEMO: >gml-exec-name ( string -- name ) >gml-name \ gml-exec-name boa ;
SYNTAX: exec" lexer get skip-blank parse-string >gml-exec-name suffix! ; SYNTAX: \exec" lexer get skip-blank parse-string >gml-exec-name suffix! ;
ERROR: unbound-name { name gml-name } ; ERROR: unbound-name { name gml-name } ;
@ -191,10 +191,10 @@ global-dictionary [ H{ } clone ] initialize
: (GML:) ( -- word name effect def ) : (GML:) ( -- word name effect def )
scan-gml-name scan-effect parse-definition ; scan-gml-name scan-effect parse-definition ;
SYNTAX: GML: SYNTAX: \GML:
(GML:) define-gml-primitive ; (GML:) define-gml-primitive ;
SYNTAX: GML:: SYNTAX: \GML::
[let [let
scan-gml-name :> ( word name ) scan-gml-name :> ( word name )
word [ parse-definition ] parse-locals-definition :> ( word def effect ) word [ parse-definition ] parse-locals-definition :> ( word def effect )

View File

@ -536,7 +536,7 @@ PRIVATE>
: define-uniform-tuple ( class superclass uniforms -- ) : define-uniform-tuple ( class superclass uniforms -- )
(define-uniform-tuple) ; inline (define-uniform-tuple) ; inline
SYNTAX: UNIFORM-TUPLE: SYNTAX: \UNIFORM-TUPLE:
parse-uniform-tuple-definition define-uniform-tuple ; parse-uniform-tuple-definition define-uniform-tuple ;
<PRIVATE <PRIVATE

View File

@ -352,7 +352,7 @@ PRIVATE>
] ]
[ "vertex-format-attributes" set-word-prop ] 2bi ; [ "vertex-format-attributes" set-word-prop ] 2bi ;
SYNTAX: VERTEX-FORMAT: SYNTAX: \VERTEX-FORMAT:
scan-new-class parse-definition scan-new-class parse-definition
[ first4 vertex-attribute boa ] map [ first4 vertex-attribute boa ] map
define-vertex-format ; define-vertex-format ;
@ -361,7 +361,7 @@ SYNTAX: VERTEX-FORMAT:
vertex-format-attributes [ vertex-attribute>struct-slot ] map vertex-format-attributes [ vertex-attribute>struct-slot ] map
define-struct-class ; define-struct-class ;
SYNTAX: VERTEX-STRUCT: SYNTAX: \VERTEX-STRUCT:
scan-new-class scan-word define-vertex-struct ; scan-new-class scan-word define-vertex-struct ;
TUPLE: vertex-array-object < gpu-object TUPLE: vertex-array-object < gpu-object
@ -544,9 +544,9 @@ TUPLE: feedback-format
PRIVATE> PRIVATE>
SYNTAX: feedback-format: SYNTAX: \feedback-format:
scan-object feedback-format boa suffix! ; scan-object feedback-format boa suffix! ;
SYNTAX: geometry-shader-vertices-out: SYNTAX: \geometry-shader-vertices-out:
scan-object geometry-shader-vertices-out boa suffix! ; scan-object geometry-shader-vertices-out boa suffix! ;
TYPED:: refresh-program ( program: program -- ) TYPED:: refresh-program ( program: program -- )
@ -585,7 +585,7 @@ TYPED: <program-instance> ( program: program -- instance: program-instance )
PRIVATE> PRIVATE>
SYNTAX: GLSL-SHADER: SYNTAX: \GLSL-SHADER:
scan-new dup scan-new dup
dup old-instances [ dup old-instances [
scan-word scan-word
@ -597,7 +597,7 @@ SYNTAX: GLSL-SHADER:
over reset-generic over reset-generic
define-constant ; define-constant ;
SYNTAX: GLSL-SHADER-FILE: SYNTAX: \GLSL-SHADER-FILE:
scan-new dup scan-new dup
dup old-instances [ dup old-instances [
scan-word execute( -- kind ) scan-word execute( -- kind )
@ -609,7 +609,7 @@ SYNTAX: GLSL-SHADER-FILE:
over reset-generic over reset-generic
define-constant ; define-constant ;
SYNTAX: GLSL-PROGRAM: SYNTAX: \GLSL-PROGRAM:
scan-new dup scan-new dup
dup old-instances [ dup old-instances [
f f

View File

@ -36,6 +36,6 @@ M: number-hash-set clone
: >number-hash-set ( members -- shash-set ) : >number-hash-set ( members -- shash-set )
[ <number-wrapper> ] map >hash-set number-hash-set boa ; [ <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 { "hash-sets.numbers" "prettyprint" } "hash-sets.numbers.prettyprint" require-when

View File

@ -39,6 +39,6 @@ M: number-hashtable clone
M: number-hashtable new-assoc drop <number-hashtable> ; 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 { "hashtables.numbers" "prettyprint" } "hashtables.numbers.prettyprint" require-when

View File

@ -139,4 +139,4 @@ SYNTAX: [infix
PRIVATE> PRIVATE>
SYNTAX: INFIX:: (INFIX::) define-declared ; SYNTAX: \INFIX:: (INFIX::) define-declared ;

View File

@ -109,7 +109,7 @@ PRIVATE>
! SYNTAX: name string parameters ; ! SYNTAX: name string parameters ;
! IRC: type "COMMAND" slot1 ...; ! IRC: type "COMMAND" slot1 ...;
! IRC: type "COMMAND" slot1 ... : trailing-slot; ! IRC: type "COMMAND" slot1 ... : trailing-slot;
SYNTAX: IRC: SYNTAX: \IRC:
scan-new-class scan-new-class
[ scan-object register-irc-message-type ] keep [ scan-object register-irc-message-type ] keep
";" parse-tokens ";" parse-tokens

View File

@ -4,6 +4,6 @@ USING: accessors effects kernel lexer math.ranges parser
sequences words ; sequences words ;
IN: math.derivatives.syntax IN: math.derivatives.syntax
SYNTAX: DERIVATIVE: scan-object dup stack-effect in>> length [1,b] SYNTAX: \DERIVATIVE: scan-object dup stack-effect in>> length [1,b]
[ drop scan-object ] map ";" expect [ drop scan-object ] map ";" expect
"derivative" set-word-prop ; "derivative" set-word-prop ;

View File

@ -49,5 +49,5 @@ PRIVATE>
: free-to-pool ( object -- ) : free-to-pool ( object -- )
dup class-of class-pool pool-free ; dup class-of class-pool pool-free ;
SYNTAX: POOL: SYNTAX: \POOL:
scan-word scan-word '[ _ swap <pool> ] [ swap set-class-pool ] bi ; scan-word scan-word '[ _ swap <pool> ] [ swap set-class-pool ] bi ;

View File

@ -3,5 +3,5 @@
USING: kernel generic generic.parser words fry ; USING: kernel generic generic.parser words fry ;
IN: method-chains IN: method-chains
SYNTAX: AFTER: (M:) dupd '[ [ _ (call-next-method) ] _ bi ] define ; SYNTAX: \AFTER: (M:) dupd '[ [ _ (call-next-method) ] _ bi ] define ;
SYNTAX: BEFORE: (M:) over '[ _ [ _ (call-next-method) ] bi ] define ; SYNTAX: \BEFORE: (M:) over '[ _ [ _ (call-next-method) ] bi ] define ;

View File

@ -31,4 +31,4 @@ ERROR: not-an-integer x ;
[ dup string>number [ ] [ not-an-integer ] ?if ] bi@ [ dup string>number [ ] [ not-an-integer ] ?if ] bi@
] keep length 10^ / + swap [ neg ] when ; ] keep length 10^ / + swap [ neg ] when ;
SYNTAX: decimal: scan-token parse-decimal suffix! ; SYNTAX: \decimal: scan-token parse-decimal suffix! ;

View File

@ -9,7 +9,7 @@ FROM: mongodb.tuple.persistent => assoc>tuple ;
IN: mongodb.tuple IN: mongodb.tuple
SYNTAX: MDBTUPLE: SYNTAX: \MDBTUPLE:
parse-tuple-definition parse-tuple-definition
mdb-check-slots mdb-check-slots
define-tuple-class ; define-tuple-class ;

View File

@ -224,7 +224,7 @@ M: no-method error.
] if ; ] if ;
! Syntax ! Syntax
SYNTAX: GENERIC: scan-new-word scan-effect define-generic ; SYNTAX: \GENERIC: scan-new-word scan-effect define-generic ;
: parse-method ( -- quot classes generic ) : parse-method ( -- quot classes generic )
parse-definition [ 2 tail ] [ second ] [ first ] tri ; parse-definition [ 2 tail ] [ second ] [ first ] tri ;
@ -237,10 +237,10 @@ SYNTAX: GENERIC: scan-new-word scan-effect define-generic ;
: (METHOD:) ( -- method def ) scan-new-method parse-definition ; : (METHOD:) ( -- method def ) scan-new-method parse-definition ;
SYNTAX: METHOD: (METHOD:) define ; SYNTAX: \METHOD: (METHOD:) define ;
! For compatibility ! For compatibility
SYNTAX: M: SYNTAX: \M:
scan-word 1array scan-word create-method-in scan-word 1array scan-word create-method-in
parse-definition parse-definition
define ; define ;

View File

@ -4,5 +4,5 @@ USING: classes.parser classes.singleton classes.union kernel lexer
sequences ; sequences ;
IN: opencl.syntax IN: opencl.syntax
SYNTAX: SINGLETONS-UNION: SYNTAX: \SINGLETONS-UNION:
scan-new-class ";" parse-tokens [ create-class-in [ define-singleton-class ] keep ] map define-union-class ; scan-new-class ";" parse-tokens [ create-class-in [ define-singleton-class ] keep ] map define-union-class ;

View File

@ -39,7 +39,7 @@ ERROR: no-pair-method a b generic ;
: (PAIR-GENERIC:) ( -- ) : (PAIR-GENERIC:) ( -- )
scan-new-generic scan-effect define-pair-generic ; scan-new-generic scan-effect define-pair-generic ;
SYNTAX: PAIR-GENERIC: (PAIR-GENERIC:) ; SYNTAX: \PAIR-GENERIC: (PAIR-GENERIC:) ;
: define-pair-method ( a b pair-generic definition -- ) : define-pair-method ( a b pair-generic definition -- )
[ 2array ] 2dip swap [ 2array ] 2dip swap
@ -54,4 +54,4 @@ SYNTAX: PAIR-GENERIC: (PAIR-GENERIC:) ;
?swap scan-word parse-definition ?swap scan-word parse-definition
] keep ?prefix-swap define-pair-method ; ] keep ?prefix-swap define-pair-method ;
SYNTAX: PAIR-M: (PAIR-M:) ; SYNTAX: \PAIR-M: (PAIR-M:) ;

View File

@ -6,7 +6,7 @@ HELP: best-holdem-hand
{ $description "Creates a new poker hand containing the best possible combination of the cards specified in " { $snippet "seq" } "." } { $description "Creates a new poker hand containing the best possible combination of the cards specified in " { $snippet "seq" } "." }
{ $examples { $examples
{ $example "USING: kernel poker prettyprint ;" { $example "USING: kernel poker prettyprint ;"
"HAND{ AS KD JC KH 2D 2S KC } best-holdem-hand drop value>hand-name ." "hand{ AS KD JC KH 2D 2S KC } best-holdem-hand drop value>hand-name ."
"\"Full House\"" "\"Full House\""
} }
} ; } ;

View File

@ -225,5 +225,5 @@ ERROR: bad-suit-symbol ch ;
: string>hand-name ( string -- string' ) : string>hand-name ( string -- string' )
string>value value>hand-name ; string>value value>hand-name ;
SYNTAX: HAND{ SYNTAX: \hand{
"}" [ card> ] map-tokens suffix! ; "}" [ card> ] map-tokens suffix! ;

View File

@ -158,7 +158,7 @@ PRIVATE>
: d-transform ( triple -- new-triple ) : d-transform ( triple -- new-triple )
{ { -1 -2 -2 } { 2 1 2 } { 2 2 3 } } transform ; { { -1 -2 -2 } { 2 1 2 } { 2 2 3 } } transform ;
SYNTAX: SOLUTION: SYNTAX: \SOLUTION:
scan-word scan-word
[ name>> "-main" append create-word-in ] keep [ name>> "-main" append create-word-in ] keep
[ drop current-vocab main<< ] [ drop current-vocab main<< ]

View File

@ -61,12 +61,12 @@ SYMBOL: current-context
PRIVATE> PRIVATE>
SYNTAX: PY-FROM: [ SYNTAX: \PY-FROM: [
current-context get f add-function current-context get f add-function
] scan-definitions ; inline ] scan-definitions ; inline
SYNTAX: PY-QUALIFIED-FROM: [ SYNTAX: \PY-QUALIFIED-FROM: [
current-context get t add-function current-context get t add-function
] scan-definitions ; inline ] scan-definitions ; inline
SYNTAX: PY-METHODS: [ add-method ] scan-definitions ; inline SYNTAX: \PY-METHODS: [ add-method ] scan-definitions ; inline

View File

@ -2,4 +2,4 @@
USING: lexer sequences parser ; USING: lexer sequences parser ;
IN: qw IN: qw
SYNTAX: qw{ "}" parse-tokens suffix! ; SYNTAX: \qw{ "}" parse-tokens suffix! ;

View File

@ -64,5 +64,5 @@ PREDICATE: role < mixin-class
[ roles>slots define-tuple-class ] [ roles>slots define-tuple-class ]
[ drop [ role? ] filter add-to-roles ] 3tri ; [ drop [ role? ] filter add-to-roles ] 3tri ;
SYNTAX: ROLE: parse-role-definition define-role ; SYNTAX: \ROLE: parse-role-definition define-role ;
SYNTAX: ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ; SYNTAX: \ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ;

View File

@ -113,7 +113,7 @@ TUPLE: slides < book ;
: strip-tease ( data -- seq ) : strip-tease ( data -- seq )
first3 2 over length [a,b] [ head 3array ] with with with map ; first3 2 over length [a,b] [ head 3array ] with with with map ;
SYNTAX: STRIP-TEASE: SYNTAX: \STRIP-TEASE:
parse-definition strip-tease append! ; parse-definition strip-tease append! ;
\ slides H{ \ slides H{

View File

@ -4,11 +4,11 @@ USING: combinators combinators.smart fry kernel lexer quotations
sequences sequences.generalizations slots words ; sequences sequences.generalizations slots words ;
IN: slots.syntax IN: slots.syntax
SYNTAX: slots[ SYNTAX: \slots[
"]" [ reader-word 1quotation ] map-tokens "]" [ reader-word 1quotation ] map-tokens
'[ _ cleave ] append! ; '[ _ cleave ] append! ;
SYNTAX: slots{ SYNTAX: \slots{
"}" [ reader-word 1quotation ] map-tokens "}" [ reader-word 1quotation ] map-tokens
'[ [ _ cleave ] output>array ] append! ; '[ [ _ cleave ] output>array ] append! ;
@ -18,23 +18,23 @@ SYNTAX: slots{
: writer-word<< ( name -- word ) : writer-word<< ( name -- word )
">>" prepend "accessors" lookup-word ; ">>" prepend "accessors" lookup-word ;
SYNTAX: set-slots[ SYNTAX: \set-slots[
"]" [ >>writer-word 1quotation ] map-tokens "]" [ >>writer-word 1quotation ] map-tokens
'[ _ spread ] append! ; '[ _ spread ] append! ;
SYNTAX: set-slots{ SYNTAX: \set-slots{
"}" [ >>writer-word 1quotation ] map-tokens "}" [ >>writer-word 1quotation ] map-tokens
[ length ] [ ] bi [ length ] [ ] bi
'[ _ firstn _ spread ] append! ; '[ _ firstn _ spread ] append! ;
SYNTAX: copy-slots{ SYNTAX: \copy-slots{
"}" [ "}" [
[ reader-word 1quotation ] [ reader-word 1quotation ]
[ writer-word<< 1quotation ] bi append [ writer-word<< 1quotation ] bi append
] map-tokens ] map-tokens
'[ swap _ cleave ] append! ; '[ swap _ cleave ] append! ;
SYNTAX: get[ postpone: slots[ ; SYNTAX: \get[ postpone: slots[ ;
SYNTAX: get{ postpone: slots{ ; SYNTAX: \get{ postpone: slots{ ;
SYNTAX: set[ postpone: set-slots[ ; SYNTAX: \set[ postpone: set-slots[ ;
SYNTAX: set{ postpone: set-slots{ ; SYNTAX: \set{ postpone: set-slots{ ;

View File

@ -25,4 +25,4 @@ SYMBOLS: unary binary keyword ;
[ selector>effect ] [ selector>effect ]
bi define-simple-generic ; bi define-simple-generic ;
SYNTAX: SELECTOR: scan-token selector>generic drop ; SYNTAX: \SELECTOR: scan-token selector>generic drop ;

Some files were not shown because too many files have changed in this diff Show More