factor: SYNTAX: \foo
parent
7ca280aee6
commit
147ae66ab5
|
@ -29,4 +29,4 @@ M: F-destructor dispose alien>> F N ndrop ;
|
|||
|
||||
;FUNCTOR>
|
||||
|
||||
SYNTAX: DESTRUCTOR: scan-word define-destructor ;
|
||||
SYNTAX: \DESTRUCTOR: scan-word define-destructor ;
|
||||
|
|
|
@ -147,18 +147,18 @@ ERROR: unsupported-endian-type endian slot ;
|
|||
[ compute-struct-offsets ] [ drop 1 ]
|
||||
(define-struct-class) ;
|
||||
|
||||
SYNTAX: LE-STRUCT:
|
||||
SYNTAX: \LE-STRUCT:
|
||||
parse-struct-definition
|
||||
little-endian define-endian-struct-class ;
|
||||
|
||||
SYNTAX: BE-STRUCT:
|
||||
SYNTAX: \BE-STRUCT:
|
||||
parse-struct-definition
|
||||
big-endian define-endian-struct-class ;
|
||||
|
||||
SYNTAX: LE-PACKED-STRUCT:
|
||||
SYNTAX: \LE-PACKED-STRUCT:
|
||||
parse-struct-definition
|
||||
little-endian define-endian-packed-struct-class ;
|
||||
|
||||
SYNTAX: BE-PACKED-STRUCT:
|
||||
SYNTAX: \BE-PACKED-STRUCT:
|
||||
parse-struct-definition
|
||||
big-endian define-endian-packed-struct-class ;
|
||||
|
|
|
@ -6,37 +6,37 @@ strings.parser vocabs words ;
|
|||
<< "alien.arrays" require >> ! needed for bootstrap
|
||||
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 ;
|
||||
|
||||
SYNTAX: FUNCTION-ALIAS:
|
||||
SYNTAX: \FUNCTION-ALIAS:
|
||||
scan-token create-function
|
||||
(FUNCTION:) (make-function) define-inline ;
|
||||
|
||||
SYNTAX: CALLBACK:
|
||||
SYNTAX: \CALLBACK:
|
||||
(CALLBACK:) define-inline ;
|
||||
|
||||
SYNTAX: TYPEDEF:
|
||||
SYNTAX: \TYPEDEF:
|
||||
scan-c-type CREATE-C-TYPE dup save-location typedef ;
|
||||
|
||||
SYNTAX: ENUM:
|
||||
SYNTAX: \ENUM:
|
||||
parse-enum (define-enum) ;
|
||||
|
||||
SYNTAX: C-TYPE:
|
||||
SYNTAX: \C-TYPE:
|
||||
void CREATE-C-TYPE typedef ;
|
||||
|
||||
SYNTAX: &:
|
||||
SYNTAX: \&:
|
||||
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! ;
|
||||
|
|
|
@ -11,6 +11,6 @@ IN: cocoa.apple-script
|
|||
<NSString> -> initWithSource: -> autorelease
|
||||
f -> executeAndReturnError: drop ;
|
||||
|
||||
SYNTAX: APPLESCRIPT:
|
||||
SYNTAX: \APPLESCRIPT:
|
||||
scan-new-word scan-object
|
||||
[ run-apple-script ] curry ( -- ) define-declared ;
|
||||
|
|
|
@ -16,7 +16,7 @@ SYNTAX: -> scan-token dup remember-send suffix! \ send suffix! ;
|
|||
|
||||
SYNTAX: ?-> scan-token dup remember-send suffix! \ ?send suffix! ;
|
||||
|
||||
SYNTAX: SEL:
|
||||
SYNTAX: \SEL:
|
||||
scan-token
|
||||
[ remember-send ]
|
||||
[ <selector> suffix! \ cocoa.messages:selector suffix! ] bi ;
|
||||
|
@ -34,9 +34,9 @@ frameworks [ V{ } clone ] initialize
|
|||
|
||||
[ 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
|
||||
|
||||
|
|
|
@ -71,12 +71,12 @@ IN: cocoa.subclassing
|
|||
TUPLE: cocoa-protocol name ;
|
||||
C: <cocoa-protocol> cocoa-protocol
|
||||
|
||||
SYNTAX: COCOA-PROTOCOL:
|
||||
SYNTAX: \COCOA-PROTOCOL:
|
||||
scan-token <cocoa-protocol> suffix! ;
|
||||
|
||||
SYMBOL: ;CLASS>
|
||||
|
||||
SYNTAX: <CLASS:
|
||||
SYNTAX: \<CLASS:
|
||||
scan-token
|
||||
"<" expect
|
||||
scan-token
|
||||
|
@ -101,7 +101,7 @@ SYNTAX: <CLASS:
|
|||
[ [ make-local ] map ] H{ } make
|
||||
(parse-lambda) <lambda> ?rewrite-closures first ;
|
||||
|
||||
SYNTAX: METHOD:
|
||||
SYNTAX: \METHOD:
|
||||
scan-c-type
|
||||
parse-selector
|
||||
parse-method-body [ swap ] 2dip 4array ";" expect
|
||||
|
|
|
@ -31,4 +31,4 @@ ERROR: no-such-color name ;
|
|||
: named-color ( name -- color )
|
||||
dup colors at [ ] [ no-such-color ] ?if ;
|
||||
|
||||
SYNTAX: color: scan-token named-color suffix! ;
|
||||
SYNTAX: \color: scan-token named-color suffix! ;
|
||||
|
|
|
@ -18,4 +18,4 @@ IN: colors.hex
|
|||
[ red>> ] [ green>> ] [ blue>> ] tri
|
||||
[ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ;
|
||||
|
||||
SYNTAX: hexcolor: scan-token hex>rgba suffix! ;
|
||||
SYNTAX: \hexcolor: scan-token hex>rgba suffix! ;
|
||||
|
|
|
@ -133,8 +133,8 @@ INSTANCE: name backward-analysis
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: FORWARD-ANALYSIS:
|
||||
SYNTAX: \FORWARD-ANALYSIS:
|
||||
scan-token [ define-analysis ] [ define-forward-analysis ] bi ;
|
||||
|
||||
SYNTAX: BACKWARD-ANALYSIS:
|
||||
SYNTAX: \BACKWARD-ANALYSIS:
|
||||
scan-token [ define-analysis ] [ define-backward-analysis ] bi ;
|
||||
|
|
|
@ -88,14 +88,14 @@ TUPLE: insn-slot-spec type name rep ;
|
|||
[ nip define-insn-ctor ]
|
||||
} 3cleave ;
|
||||
|
||||
SYNTAX: INSN:
|
||||
SYNTAX: \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 ;
|
||||
|
||||
SYNTAX: FLUSHABLE-INSN:
|
||||
SYNTAX: \FLUSHABLE-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 ;
|
||||
|
|
|
@ -32,5 +32,5 @@ C: <ds-loc> ds-loc
|
|||
TUPLE: rs-loc < loc ;
|
||||
C: <rs-loc> rs-loc
|
||||
|
||||
SYNTAX: d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: r: scan-number <rs-loc> suffix! ;
|
||||
SYNTAX: \d: scan-number <ds-loc> suffix! ;
|
||||
SYNTAX: \r: scan-number <rs-loc> suffix! ;
|
||||
|
|
|
@ -85,4 +85,4 @@ insn-classes get [ insn-temp-slots empty? ] reject [
|
|||
|
||||
;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 ;
|
||||
|
|
|
@ -117,7 +117,7 @@ M: ##epilogue generate-insn
|
|||
[ insn-slot-quot ] map cleave>quot
|
||||
] dip suffix ;
|
||||
|
||||
SYNTAX: CODEGEN:
|
||||
SYNTAX: \CODEGEN:
|
||||
scan-word [ \ generate-insn create-method-in ] keep scan-word
|
||||
codegen-method-body define ;
|
||||
|
||||
|
@ -268,7 +268,7 @@ CODEGEN: ##reload %reload
|
|||
! Conditional branches
|
||||
<<
|
||||
|
||||
SYNTAX: CONDITIONAL:
|
||||
SYNTAX: \CONDITIONAL:
|
||||
scan-word [ \ generate-conditional-insn create-method-in ] keep scan-word
|
||||
codegen-method-body define ;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ FUNCTION: CFStringRef CFCopyTypeIDDescription ( CFTypeID type_id )
|
|||
: CFType>description ( cf -- description )
|
||||
CFGetTypeID [ CFCopyTypeIDDescription &CFRelease CF>string ] with-destructors ;
|
||||
|
||||
SYNTAX: CFSTRING:
|
||||
SYNTAX: \CFSTRING:
|
||||
scan-new-word scan-object
|
||||
[ drop ] [ '[ _ [ _ <CFString> ] initialize-alien ] ] 2bi
|
||||
( -- alien ) define-declared ;
|
||||
|
|
|
@ -22,8 +22,8 @@ registers [ H{ } clone ] initialize
|
|||
: define-registers ( names size -- )
|
||||
[ [ 0 ] dip (define-registers) ] keep registers get set-at ;
|
||||
|
||||
SYNTAX: REGISTERS:
|
||||
SYNTAX: \REGISTERS:
|
||||
scan-number [ ";" parse-tokens ] dip define-registers ;
|
||||
|
||||
SYNTAX: HI-REGISTERS:
|
||||
SYNTAX: \HI-REGISTERS:
|
||||
scan-number [ ";" parse-tokens 4 ] dip (define-registers) drop ;
|
||||
|
|
|
@ -24,7 +24,7 @@ icons [ H{ } clone ] initialize
|
|||
define
|
||||
] 2bi ;
|
||||
|
||||
SYNTAX: ICON: scan-word scan-token define-icon ;
|
||||
SYNTAX: \ICON: scan-word scan-token define-icon ;
|
||||
|
||||
>>
|
||||
|
||||
|
|
|
@ -109,11 +109,11 @@ PRIVATE>
|
|||
: define-consult ( consultation -- )
|
||||
[ register-consult ] [ consult-methods ] bi ;
|
||||
|
||||
SYNTAX: CONSULT:
|
||||
SYNTAX: \CONSULT:
|
||||
scan-word scan-word parse-definition <consultation>
|
||||
[ save-location ] [ define-consult ] bi ;
|
||||
|
||||
SYNTAX: BROADCAST:
|
||||
SYNTAX: \BROADCAST:
|
||||
scan-word scan-word parse-definition <broadcast>
|
||||
[ save-location ] [ define-consult ] bi ;
|
||||
|
||||
|
@ -176,7 +176,7 @@ PRIVATE>
|
|||
[ initialize-protocol-props ] 2tri
|
||||
] 2bi ;
|
||||
|
||||
SYNTAX: PROTOCOL:
|
||||
SYNTAX: \PROTOCOL:
|
||||
scan-new-word parse-definition define-protocol ;
|
||||
|
||||
PREDICATE: protocol < word protocol-words ; ! Subclass of symbol?
|
||||
|
@ -190,7 +190,7 @@ M: protocol definer drop \ PROTOCOL: \ ; ;
|
|||
|
||||
M: protocol group-words protocol-words ;
|
||||
|
||||
SYNTAX: SLOT-PROTOCOL:
|
||||
SYNTAX: \SLOT-PROTOCOL:
|
||||
scan-new-word ";"
|
||||
[ [ reader-word ] [ writer-word ] bi 2array ]
|
||||
map-tokens concat define-protocol ;
|
||||
|
|
|
@ -82,7 +82,7 @@ FUNCTOR-SYNTAX: \M:
|
|||
parse-definition*
|
||||
\ define* suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: C:
|
||||
FUNCTOR-SYNTAX: \C:
|
||||
scan-param suffix!
|
||||
scan-param [
|
||||
suffix!
|
||||
|
@ -90,31 +90,31 @@ FUNCTOR-SYNTAX: C:
|
|||
] keep suffix! \ boa-effect suffix!
|
||||
\ define-declared* suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: :
|
||||
FUNCTOR-SYNTAX: \:
|
||||
scan-param suffix!
|
||||
parse-declared*
|
||||
\ define-declared* suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: SYMBOL:
|
||||
FUNCTOR-SYNTAX: \SYMBOL:
|
||||
scan-param suffix!
|
||||
\ define-symbol suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: SYNTAX:
|
||||
FUNCTOR-SYNTAX: \SYNTAX:
|
||||
scan-param suffix!
|
||||
parse-definition*
|
||||
\ define-syntax suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: INSTANCE:
|
||||
FUNCTOR-SYNTAX: \INSTANCE:
|
||||
scan-param suffix!
|
||||
scan-param suffix!
|
||||
\ add-mixin-instance suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: GENERIC:
|
||||
FUNCTOR-SYNTAX: \GENERIC:
|
||||
scan-param suffix!
|
||||
scan-effect suffix!
|
||||
\ define-simple-generic* suffix! ;
|
||||
|
||||
FUNCTOR-SYNTAX: MACRO:
|
||||
FUNCTOR-SYNTAX: \MACRO:
|
||||
scan-param suffix!
|
||||
parse-declared*
|
||||
\ define-macro suffix! ;
|
||||
|
|
|
@ -53,17 +53,17 @@ M: gir-not-found summary
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: GIR: scan-token define-gir-vocab ;
|
||||
SYNTAX: \GIR: scan-token define-gir-vocab ;
|
||||
|
||||
SYNTAX: IMPLEMENT-STRUCTS:
|
||||
SYNTAX: \IMPLEMENT-STRUCTS:
|
||||
";" parse-tokens
|
||||
implement-structs [ swap append! ] change-global ;
|
||||
|
||||
SYNTAX: FOREIGN-ATOMIC-TYPE:
|
||||
SYNTAX: \FOREIGN-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 ;
|
||||
|
||||
SYNTAX: FOREIGN-RECORD-TYPE:
|
||||
SYNTAX: \FOREIGN-RECORD-TYPE:
|
||||
scan-token scan-object swap register-record-type ;
|
||||
|
|
|
@ -41,7 +41,7 @@ M: identity-hashtable assoc-like
|
|||
|
||||
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" "mirrors" } "hashtables.identity.mirrors" require-when
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -4,7 +4,7 @@ USING: accessors arrays compiler.units definitions help
|
|||
help.topics kernel math parser sequences vocabs.parser words ;
|
||||
IN: help.syntax
|
||||
|
||||
SYNTAX: HELP:
|
||||
SYNTAX: \HELP:
|
||||
scan-word bootstrap-word
|
||||
[ >link save-location ]
|
||||
[ [ parse-array-def ] dip set-word-help ]
|
||||
|
@ -12,7 +12,7 @@ SYNTAX: HELP:
|
|||
|
||||
ERROR: article-expects-name-and-title got ;
|
||||
|
||||
SYNTAX: ARTICLE:
|
||||
SYNTAX: \ARTICLE:
|
||||
location [
|
||||
parse-array-def
|
||||
dup length 2 < [ article-expects-name-and-title ] when
|
||||
|
@ -20,5 +20,5 @@ SYNTAX: ARTICLE:
|
|||
over add-article >link
|
||||
] dip remember-definition ;
|
||||
|
||||
SYNTAX: ABOUT:
|
||||
SYNTAX: \ABOUT:
|
||||
current-vocab scan-object >>help changed-definition ;
|
||||
|
|
|
@ -21,7 +21,7 @@ M: tip set-where loc<< ;
|
|||
|
||||
: add-tip ( tip -- ) tips get push ;
|
||||
|
||||
SYNTAX: TIP:
|
||||
SYNTAX: \TIP:
|
||||
parse-array-def <tip>
|
||||
[ save-location ] [ add-tip ] bi ;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ ERROR: cannot-specialize word specializer ;
|
|||
over inline-recursive? [ cannot-specialize ] when
|
||||
"specializer" set-word-prop ;
|
||||
|
||||
SYNTAX: HINTS:
|
||||
SYNTAX: \HINTS:
|
||||
scan-object dup wrapper? [ wrapped>> ] when
|
||||
[ changed-definition ]
|
||||
[ subwords [ changed-definition ] each ]
|
||||
|
|
|
@ -31,7 +31,7 @@ M: tuple-class component-tag ( tag class -- )
|
|||
[ compile-component-attrs ] 2bi
|
||||
render-quot [code] ;
|
||||
|
||||
SYNTAX: COMPONENT:
|
||||
SYNTAX: \COMPONENT:
|
||||
scan-word
|
||||
[ name>> ] [ '[ _ component-tag ] ] bi
|
||||
define-chloe-tag ;
|
||||
|
|
|
@ -13,7 +13,7 @@ tags [ H{ } clone ] initialize
|
|||
|
||||
: define-chloe-tag ( name quot -- ) swap tags get set-at ;
|
||||
|
||||
SYNTAX: CHLOE:
|
||||
SYNTAX: \CHLOE:
|
||||
scan-token parse-definition define-chloe-tag ;
|
||||
|
||||
CONSTANT: chloe-ns "http://factorcode.org/chloe/1.0"
|
||||
|
|
|
@ -54,4 +54,4 @@ M: 8-bit-encoding <decoder>
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: 8-BIT: scan-token scan-token scan-token load-encoding ;
|
||||
SYNTAX: \8-BIT: scan-token scan-token scan-token load-encoding ;
|
||||
|
|
|
@ -63,6 +63,6 @@ SYMBOL: euc-table
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: EUC:
|
||||
SYNTAX: \EUC:
|
||||
! EUC: euc-kr "vocab:io/encodings/korean/cp949.txt"
|
||||
scan-new-class scan-object define-euc ;
|
||||
|
|
|
@ -13,15 +13,15 @@ SYNTAX: [| parse-lambda 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"
|
||||
|
|
|
@ -137,7 +137,7 @@ PRIVATE>
|
|||
[ [ input-logging-quot ] 2keep drop error-logging-quot ]
|
||||
(define-logging) ;
|
||||
|
||||
SYNTAX: LOG:
|
||||
SYNTAX: \LOG:
|
||||
! Syntax: name level
|
||||
scan-new-word dup scan-word
|
||||
'[ 1array stack>message _ _ log-message ]
|
||||
|
|
|
@ -27,7 +27,7 @@ PRIVATE>
|
|||
[ 2drop changed-effect ]
|
||||
} 3cleave ;
|
||||
|
||||
SYNTAX: MACRO: (:) define-macro ;
|
||||
SYNTAX: \MACRO: (:) define-macro ;
|
||||
|
||||
PREDICATE: macro < word "macro" word-prop >boolean ;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ SYMBOL: _
|
|||
: define-match-vars ( seq -- )
|
||||
[ define-match-var ] each ;
|
||||
|
||||
SYNTAX: MATCH-VARS: ! vars ...
|
||||
SYNTAX: \MATCH-VARS: ! vars ...
|
||||
";" [ define-match-var ] each-token ;
|
||||
|
||||
PREDICATE: match-var < word "match-var" word-prop ;
|
||||
|
|
|
@ -40,7 +40,7 @@ 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
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ IN: math.rectangles.prettyprint
|
|||
|
||||
M: rect pprint*
|
||||
[
|
||||
\ RECT: [
|
||||
\ rect: [
|
||||
[ loc>> ] [ dim>> ] bi [ pprint* ] bi@
|
||||
] pprint-prefix
|
||||
] check-recursion ;
|
||||
|
|
|
@ -2,39 +2,39 @@ USING: tools.test math.rectangles prettyprint io.streams.string
|
|||
kernel accessors ;
|
||||
IN: math.rectangles.tests
|
||||
|
||||
{ RECT: { 10 10 } { 20 20 } }
|
||||
{ rect: { 10 10 } { 20 20 } }
|
||||
[
|
||||
RECT: { 10 10 } { 50 50 }
|
||||
RECT: { -10 -10 } { 40 40 }
|
||||
rect: { 10 10 } { 50 50 }
|
||||
rect: { -10 -10 } { 40 40 }
|
||||
rect-intersect
|
||||
] unit-test
|
||||
|
||||
{ RECT: { 200 200 } { 0 0 } }
|
||||
{ rect: { 200 200 } { 0 0 } }
|
||||
[
|
||||
RECT: { 100 100 } { 50 50 }
|
||||
RECT: { 200 200 } { 40 40 }
|
||||
rect: { 100 100 } { 50 50 }
|
||||
rect: { 200 200 } { 40 40 }
|
||||
rect-intersect
|
||||
] unit-test
|
||||
|
||||
{ f } [
|
||||
RECT: { 100 100 } { 50 50 }
|
||||
RECT: { 200 200 } { 40 40 }
|
||||
rect: { 100 100 } { 50 50 }
|
||||
rect: { 200 200 } { 40 40 }
|
||||
contains-rect?
|
||||
] unit-test
|
||||
|
||||
{ t } [
|
||||
RECT: { 100 100 } { 50 50 }
|
||||
RECT: { 120 120 } { 40 40 }
|
||||
rect: { 100 100 } { 50 50 }
|
||||
rect: { 120 120 } { 40 40 }
|
||||
contains-rect?
|
||||
] unit-test
|
||||
|
||||
{ f } [
|
||||
RECT: { 1000 100 } { 50 50 }
|
||||
RECT: { 120 120 } { 40 40 }
|
||||
rect: { 1000 100 } { 50 50 }
|
||||
rect: { 120 120 } { 40 40 }
|
||||
contains-rect?
|
||||
] unit-test
|
||||
|
||||
{ RECT: { 10 20 } { 20 20 } } [
|
||||
{ rect: { 10 20 } { 20 20 } } [
|
||||
{
|
||||
{ 20 20 }
|
||||
{ 10 40 }
|
||||
|
@ -42,5 +42,5 @@ IN: math.rectangles.tests
|
|||
} rect-containing
|
||||
] unit-test
|
||||
|
||||
! Prettyprint for RECT: didn't do nesting check properly
|
||||
{ } [ [ RECT: f f dup >>dim . ] with-string-writer drop ] unit-test
|
||||
! Prettyprint for rect: didn't do nesting check properly
|
||||
{ } [ [ rect: f f dup >>dim . ] with-string-writer drop ] unit-test
|
||||
|
|
|
@ -8,7 +8,7 @@ TUPLE: rect { loc initial: { 0 0 } } { dim initial: { 0 0 } } ;
|
|||
|
||||
: <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
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ SYNTAX: A{ \ } [ >A ] parse-literal ;
|
|||
[ define-specialized-cord ]
|
||||
[ create-word-in (define-simd-128-cord) ] 2bi ;
|
||||
|
||||
SYNTAX: SIMD-128-CORD:
|
||||
SYNTAX: \SIMD-128-CORD:
|
||||
scan-word scan-token define-simd-128-cord ;
|
||||
|
||||
PRIVATE>
|
||||
|
|
|
@ -331,7 +331,7 @@ c:<c-type>
|
|||
|
||||
;FUNCTOR>
|
||||
|
||||
SYNTAX: SIMD-128:
|
||||
SYNTAX: \SIMD-128:
|
||||
scan-token define-simd-128 ;
|
||||
|
||||
PRIVATE>
|
||||
|
|
|
@ -69,9 +69,9 @@ PRIVATE>
|
|||
dup in>> length zero? [ f 1array ] [ IH{ } clone ] if
|
||||
(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 ;
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ xyz
|
|||
|
||||
/*
|
||||
<<
|
||||
SYNTAX: MULTILINE-LITERAL: parse-here suffix! ;
|
||||
SYNTAX: \MULTILINE-LITERAL: parse-here suffix! ;
|
||||
>>
|
||||
|
||||
{ { "bar" } }
|
||||
|
|
|
@ -49,7 +49,7 @@ reset-gl-function-number-counter
|
|||
: gl-function-calling-convention ( -- symbol )
|
||||
os windows? [ stdcall ] [ cdecl ] if ;
|
||||
|
||||
SYNTAX: GL-FUNCTION:
|
||||
SYNTAX: \GL-FUNCTION:
|
||||
gl-function-calling-convention
|
||||
scan-function-name
|
||||
"{" expect "}" parse-tokens over suffix
|
||||
|
|
|
@ -537,7 +537,7 @@ ERROR: could-not-parse-ebnf ;
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: EBNF:
|
||||
SYNTAX: \EBNF:
|
||||
reset-tokenizer
|
||||
scan-new-word dup scan-object
|
||||
ebnf>quot swapd
|
||||
|
@ -549,13 +549,13 @@ SYNTAX: EBNF:
|
|||
ebnf>quot nip
|
||||
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
|
||||
scan-new-word
|
||||
scan-object parse-ebnf main of '[ _ ]
|
||||
|
|
|
@ -607,7 +607,7 @@ PRIVATE>
|
|||
|
||||
ERROR: parse-failed input word ;
|
||||
|
||||
SYNTAX: PEG:
|
||||
SYNTAX: \PEG:
|
||||
[let
|
||||
(:) :> ( word def effect )
|
||||
[
|
||||
|
|
|
@ -53,7 +53,7 @@ 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-sequence >alist ;
|
||||
|
|
|
@ -181,7 +181,7 @@ 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-sequence ;
|
||||
|
|
|
@ -17,5 +17,5 @@ TUPLE: promise quot forced? value ;
|
|||
: make-lazy-quot ( quot effect -- quot )
|
||||
in>> length '[ _ _ ncurry <promise> ] ;
|
||||
|
||||
SYNTAX: LAZY:
|
||||
SYNTAX: \LAZY:
|
||||
(:) [ make-lazy-quot ] keep define-declared ;
|
||||
|
|
|
@ -56,7 +56,7 @@ PRIVATE>
|
|||
|
||||
<<
|
||||
|
||||
SYNTAX: ROMAN-OP:
|
||||
SYNTAX: \ROMAN-OP:
|
||||
scan-word [ name>> "roman" prepend create-word-in ] keep
|
||||
1quotation '[ _ binary-roman-op ]
|
||||
scan-effect define-declared ;
|
||||
|
@ -69,4 +69,4 @@ ROMAN-OP: * ( x y -- z )
|
|||
ROMAN-OP: /i ( x y -- z )
|
||||
ROMAN-OP: /mod ( x y -- z w )
|
||||
|
||||
SYNTAX: ROMAN: scan-token roman> suffix! ;
|
||||
SYNTAX: \ROMAN: scan-token roman> suffix! ;
|
||||
|
|
|
@ -128,7 +128,7 @@ MACRO: <experiment> ( word -- quot )
|
|||
|
||||
<<
|
||||
|
||||
SYNTAX: TEST:
|
||||
SYNTAX: \TEST:
|
||||
scan-token
|
||||
[ create-word-in ]
|
||||
[ "(" ")" surround search '[ _ parse-test ] ] bi
|
||||
|
|
|
@ -169,6 +169,6 @@ IN: syntax
|
|||
|
||||
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 ]
|
||||
prepose call( accum -- accum ) ;
|
||||
|
|
|
@ -41,7 +41,7 @@ M: bad-tr summary
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: TR:
|
||||
SYNTAX: \TR:
|
||||
scan-token parse-definition
|
||||
unclip-last [ unclip-last ] dip compute-tr
|
||||
[ check-tr ]
|
||||
|
|
|
@ -160,9 +160,9 @@ PRIVATE>
|
|||
[ drop "typed-def" set-word-prop ]
|
||||
[ 2drop "typed-word" word-prop set-last-word ] 3tri ;
|
||||
|
||||
SYNTAX: TYPED:
|
||||
SYNTAX: \TYPED:
|
||||
(:) define-typed ;
|
||||
SYNTAX: TYPED::
|
||||
SYNTAX: \TYPED::
|
||||
(::) define-typed ;
|
||||
|
||||
USE: vocabs.loader
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
USING: ui.gadgets prettyprint.backend prettyprint.custom ;
|
||||
IN: ui.gadgets.prettyprint
|
||||
|
||||
! Don't print gadgets with RECT: syntax
|
||||
! Don't print gadgets with rect: syntax
|
||||
M: gadget pprint* pprint-tuple ;
|
||||
|
|
|
@ -229,13 +229,13 @@ HOOK: system-alert ui-backend ( caption text -- )
|
|||
: define-window ( word attributes quot -- )
|
||||
'[ [ f _ clone @ open-window ] with-ui ] ( -- ) define-declared ;
|
||||
|
||||
SYNTAX: WINDOW:
|
||||
SYNTAX: \WINDOW:
|
||||
scan-new-word
|
||||
world-attributes parse-window-attributes
|
||||
parse-definition
|
||||
define-window ;
|
||||
|
||||
SYNTAX: MAIN-WINDOW:
|
||||
SYNTAX: \MAIN-WINDOW:
|
||||
scan-new-word
|
||||
world-attributes parse-window-attributes
|
||||
parse-definition
|
||||
|
|
|
@ -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>
|
||||
|
||||
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 ;
|
||||
|
|
|
@ -50,7 +50,7 @@ M: vlist like
|
|||
|
||||
INSTANCE: vlist immutable-sequence
|
||||
|
||||
SYNTAX: VL{ \ } [ >vlist ] parse-literal ;
|
||||
SYNTAX: \VL{ \ } [ >vlist ] parse-literal ;
|
||||
|
||||
M: vlist pprint-delims drop \ VL{ \ } ;
|
||||
M: vlist >pprint-sequence ;
|
||||
|
|
|
@ -82,7 +82,7 @@ ERROR: no-com-interface interface ;
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: COM-INTERFACE:
|
||||
SYNTAX: \COM-INTERFACE:
|
||||
CREATE-C-TYPE
|
||||
void* over typedef
|
||||
scan-object find-com-interface-definition
|
||||
|
@ -92,7 +92,7 @@ SYNTAX: COM-INTERFACE:
|
|||
dup save-com-interface-definition
|
||||
define-words-for-com-interface ;
|
||||
|
||||
SYNTAX: GUID: scan-token string>guid suffix! ;
|
||||
SYNTAX: \GUID: scan-token string>guid suffix! ;
|
||||
|
||||
USE: vocabs.loader
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: alien.syntax alien.parser words x11.io sequences kernel ;
|
||||
IN: x11.syntax
|
||||
|
||||
SYNTAX: X-FUNCTION:
|
||||
SYNTAX: \X-FUNCTION:
|
||||
(FUNCTION:) make-function
|
||||
[ \ awaken-event-loop suffix ] dip
|
||||
define-declared ;
|
||||
|
|
|
@ -25,7 +25,7 @@ PREDICATE: generated-xml-error < tuple class-of "xml-error-class" word-prop ;
|
|||
]
|
||||
} 3cleave ;
|
||||
|
||||
SYNTAX: XML-ERROR:
|
||||
SYNTAX: \XML-ERROR:
|
||||
parse-tuple-definition pick save-location
|
||||
define-xml-error-class ;
|
||||
|
||||
|
|
|
@ -27,16 +27,16 @@ M: no-tag summary
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: TAGS:
|
||||
SYNTAX: \TAGS:
|
||||
scan-new-word scan-effect
|
||||
[ drop H{ } clone "xtable" set-word-prop ]
|
||||
[ define-tags ]
|
||||
2bi ;
|
||||
|
||||
SYNTAX: TAG:
|
||||
SYNTAX: \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 ;
|
||||
|
||||
<PRIVATE
|
||||
|
|
|
@ -10,7 +10,7 @@ IN: xmode.loader.syntax
|
|||
: (parse-rule-tag) ( rule-set tag specs class -- )
|
||||
new swap init-from-tag swap add-rule ; inline
|
||||
|
||||
SYNTAX: RULE:
|
||||
SYNTAX: \RULE:
|
||||
scan-token scan-word scan-word [
|
||||
[ parse-definition call( -- ) ] { } make
|
||||
swap [ (parse-rule-tag) ] 2curry
|
||||
|
|
|
@ -123,8 +123,8 @@ MACRO: data-map! ( ins outs -- quot )
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: data-map(
|
||||
SYNTAX: \data-map(
|
||||
parse-data-map-effect \ data-map suffix! ;
|
||||
|
||||
SYNTAX: data-map!(
|
||||
SYNTAX: \data-map!(
|
||||
parse-data-map-effect \ data-map! suffix! ;
|
||||
|
|
|
@ -440,15 +440,15 @@ MACRO: fortran-invoke ( return library function parameters -- quot )
|
|||
return library function parameters return [ c:void ] unless* parse-arglist
|
||||
[ \ fortran-invoke 5 [ ] nsequence ] dip define-declared ;
|
||||
|
||||
SYNTAX: SUBROUTINE:
|
||||
SYNTAX: \SUBROUTINE:
|
||||
f current-library get scan-token ")" parse-tokens
|
||||
[ "()" subseq? ] reject define-fortran-function ;
|
||||
|
||||
SYNTAX: FUNCTION:
|
||||
SYNTAX: \FUNCTION:
|
||||
scan-token current-library get scan-token ")" parse-tokens
|
||||
[ "()" subseq? ] reject define-fortran-function ;
|
||||
|
||||
SYNTAX: LIBRARY:
|
||||
SYNTAX: \LIBRARY:
|
||||
scan-token
|
||||
[ current-library set ]
|
||||
[ set-fortran-abi ] bi ;
|
||||
|
|
|
@ -192,7 +192,7 @@ 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* ;
|
||||
|
|
|
@ -7,14 +7,14 @@ IN: calendar.holidays
|
|||
SINGLETONS: all world commonwealth-of-nations ;
|
||||
|
||||
<<
|
||||
SYNTAX: HOLIDAY:
|
||||
SYNTAX: \HOLIDAY:
|
||||
scan-new-word
|
||||
dup "holiday" word-prop [
|
||||
dup H{ } clone "holiday" set-word-prop
|
||||
] unless
|
||||
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
|
||||
value name holidays set-at ] ;
|
||||
>>
|
||||
|
|
|
@ -8,4 +8,4 @@ MACRO: inline-changer ( name -- quot' )
|
|||
[ "accessors" lookup-word 1quotation ] bi@
|
||||
'[ over [ [ @ ] dip call ] dip swap @ ] ;
|
||||
|
||||
SYNTAX: change: scan-token '[ _ inline-changer ] append! ;
|
||||
SYNTAX: \change: scan-token '[ _ inline-changer ] append! ;
|
||||
|
|
|
@ -113,5 +113,5 @@ M: T-array struct-transpose
|
|||
|
||||
;FUNCTOR>
|
||||
|
||||
SYNTAX: VECTORED-STRUCT:
|
||||
SYNTAX: \VECTORED-STRUCT:
|
||||
scan-word define-vectored-struct ;
|
||||
|
|
|
@ -32,4 +32,4 @@ PRIVATE>
|
|||
: flex-hex>rgba ( str -- rgba )
|
||||
flex-hex hex>rgba ;
|
||||
|
||||
SYNTAX: flexhexcolor: scan-token flex-hex>rgba suffix! ;
|
||||
SYNTAX: \flexhexcolor: scan-token flex-hex>rgba suffix! ;
|
||||
|
|
|
@ -47,7 +47,7 @@ ERROR: unknown-constructor-parameters class effect unknown ;
|
|||
scan-constructor scan-effect ensure-constructor-parameters
|
||||
parse-definition ;
|
||||
|
||||
SYNTAX: CONSTRUCTOR:
|
||||
SYNTAX: \CONSTRUCTOR:
|
||||
parse-constructor
|
||||
[ [ constructor-boa-quot ] dip compose ]
|
||||
[ drop ] 2bi define-declared ;
|
||||
|
@ -59,6 +59,6 @@ SYNTAX: CONSTRUCTOR:
|
|||
: scan-full-input-effect ( -- effect )
|
||||
"(" expect scan-rest-input-effect ;
|
||||
|
||||
SYNTAX: SLOT-CONSTRUCTOR:
|
||||
SYNTAX: \SLOT-CONSTRUCTOR:
|
||||
scan-new-word [ name>> "(" append create-reset ] keep
|
||||
'[ scan-rest-input-effect in>> _ '[ _ _ slots>boa ] append! ] define-syntax ;
|
||||
|
|
|
@ -1381,13 +1381,13 @@ SYMBOL: last-opcode
|
|||
dup last-instruction set-global
|
||||
] 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.
|
||||
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.
|
||||
last-instruction get-global 1quotation scan-token hex>
|
||||
dup last-opcode set-global set-instruction ;
|
||||
|
|
|
@ -11,7 +11,7 @@ SYMBOL: registers
|
|||
|
||||
V{ } registers set-global
|
||||
|
||||
SYNTAX: REGISTER:
|
||||
SYNTAX: \REGISTER:
|
||||
scan-new-word
|
||||
[ define-symbol ]
|
||||
[ registers get length "register" set-word-prop ]
|
||||
|
|
|
@ -4,15 +4,15 @@ USING: alien.parser cuda.libraries fry kernel lexer namespaces
|
|||
parser ;
|
||||
IN: cuda.syntax
|
||||
|
||||
SYNTAX: CUDA-LIBRARY:
|
||||
SYNTAX: \CUDA-LIBRARY:
|
||||
scan-token scan-word scan-object
|
||||
'[ _ _ add-cuda-library ]
|
||||
[ current-cuda-library set-global ] bi ;
|
||||
|
||||
SYNTAX: CUDA-FUNCTION:
|
||||
SYNTAX: \CUDA-FUNCTION:
|
||||
scan-token [ create-word-in current-cuda-library get ] keep
|
||||
scan-c-args define-cuda-function ;
|
||||
|
||||
SYNTAX: CUDA-GLOBAL:
|
||||
SYNTAX: \CUDA-GLOBAL:
|
||||
scan-token [ create-word-in current-cuda-library get ] keep
|
||||
define-cuda-global ;
|
||||
|
|
|
@ -19,7 +19,7 @@ C: <decimal> decimal
|
|||
|
||||
: parse-decimal ( -- decimal ) scan-token string>decimal ;
|
||||
|
||||
SYNTAX: decimal: parse-decimal suffix! ;
|
||||
SYNTAX: \decimal: parse-decimal suffix! ;
|
||||
|
||||
: decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ PRIVATE>
|
|||
[ [ [ dup ] 2dip [descriptive] ] keep define-declared ]
|
||||
3bi ;
|
||||
|
||||
SYNTAX: DESCRIPTIVE: (:) define-descriptive ;
|
||||
SYNTAX: \DESCRIPTIVE: (:) define-descriptive ;
|
||||
|
||||
PREDICATE: descriptive < word
|
||||
"descriptive-definition" word-prop >boolean ;
|
||||
|
@ -45,7 +45,7 @@ M: descriptive definer drop \ DESCRIPTIVE: \ ; ;
|
|||
M: descriptive definition
|
||||
"descriptive-definition" word-prop ;
|
||||
|
||||
SYNTAX: DESCRIPTIVE:: (::) define-descriptive ;
|
||||
SYNTAX: \DESCRIPTIVE:: (::) define-descriptive ;
|
||||
|
||||
INTERSECTION: descriptive-lambda descriptive lambda-word ;
|
||||
|
||||
|
|
|
@ -26,4 +26,4 @@ IN: dice
|
|||
'[ _ _ random-roll ]
|
||||
] if* ;
|
||||
|
||||
SYNTAX: ROLL: scan-token roll-quot append! ;
|
||||
SYNTAX: \ROLL: scan-token roll-quot append! ;
|
||||
|
|
|
@ -79,7 +79,7 @@ M: game-world apply-world-attributes
|
|||
: define-attributes-word ( word tuple -- )
|
||||
[ name>> "-attributes" append create-word-in ] dip define-constant ;
|
||||
|
||||
SYNTAX: GAME:
|
||||
SYNTAX: \GAME:
|
||||
scan-new-word
|
||||
game-attributes parse-window-attributes
|
||||
2dup define-attributes-word
|
||||
|
|
|
@ -27,7 +27,7 @@ SYMBOL: current-macro
|
|||
MACRO:: log-euler-op ( class def inputs -- quot )
|
||||
class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ;
|
||||
|
||||
SYNTAX: LOG-GML:
|
||||
SYNTAX: \LOG-GML:
|
||||
[let
|
||||
(GML:) :> ( word name effect def )
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ FROM: kernel.private => declare ;
|
|||
scan-word \ (exec) create-method-in
|
||||
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 ;
|
||||
|
||||
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 } ;
|
||||
|
||||
|
@ -191,10 +191,10 @@ global-dictionary [ H{ } clone ] initialize
|
|||
: (GML:) ( -- word name effect def )
|
||||
scan-gml-name scan-effect parse-definition ;
|
||||
|
||||
SYNTAX: GML:
|
||||
SYNTAX: \GML:
|
||||
(GML:) define-gml-primitive ;
|
||||
|
||||
SYNTAX: GML::
|
||||
SYNTAX: \GML::
|
||||
[let
|
||||
scan-gml-name :> ( word name )
|
||||
word [ parse-definition ] parse-locals-definition :> ( word def effect )
|
||||
|
|
|
@ -536,7 +536,7 @@ PRIVATE>
|
|||
: define-uniform-tuple ( class superclass uniforms -- )
|
||||
(define-uniform-tuple) ; inline
|
||||
|
||||
SYNTAX: UNIFORM-TUPLE:
|
||||
SYNTAX: \UNIFORM-TUPLE:
|
||||
parse-uniform-tuple-definition define-uniform-tuple ;
|
||||
|
||||
<PRIVATE
|
||||
|
|
|
@ -352,7 +352,7 @@ PRIVATE>
|
|||
]
|
||||
[ "vertex-format-attributes" set-word-prop ] 2bi ;
|
||||
|
||||
SYNTAX: VERTEX-FORMAT:
|
||||
SYNTAX: \VERTEX-FORMAT:
|
||||
scan-new-class parse-definition
|
||||
[ first4 vertex-attribute boa ] map
|
||||
define-vertex-format ;
|
||||
|
@ -361,7 +361,7 @@ SYNTAX: VERTEX-FORMAT:
|
|||
vertex-format-attributes [ vertex-attribute>struct-slot ] map
|
||||
define-struct-class ;
|
||||
|
||||
SYNTAX: VERTEX-STRUCT:
|
||||
SYNTAX: \VERTEX-STRUCT:
|
||||
scan-new-class scan-word define-vertex-struct ;
|
||||
|
||||
TUPLE: vertex-array-object < gpu-object
|
||||
|
@ -544,9 +544,9 @@ TUPLE: feedback-format
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: feedback-format:
|
||||
SYNTAX: \feedback-format:
|
||||
scan-object feedback-format boa suffix! ;
|
||||
SYNTAX: geometry-shader-vertices-out:
|
||||
SYNTAX: \geometry-shader-vertices-out:
|
||||
scan-object geometry-shader-vertices-out boa suffix! ;
|
||||
|
||||
TYPED:: refresh-program ( program: program -- )
|
||||
|
@ -585,7 +585,7 @@ TYPED: <program-instance> ( program: program -- instance: program-instance )
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: GLSL-SHADER:
|
||||
SYNTAX: \GLSL-SHADER:
|
||||
scan-new dup
|
||||
dup old-instances [
|
||||
scan-word
|
||||
|
@ -597,7 +597,7 @@ SYNTAX: GLSL-SHADER:
|
|||
over reset-generic
|
||||
define-constant ;
|
||||
|
||||
SYNTAX: GLSL-SHADER-FILE:
|
||||
SYNTAX: \GLSL-SHADER-FILE:
|
||||
scan-new dup
|
||||
dup old-instances [
|
||||
scan-word execute( -- kind )
|
||||
|
@ -609,7 +609,7 @@ SYNTAX: GLSL-SHADER-FILE:
|
|||
over reset-generic
|
||||
define-constant ;
|
||||
|
||||
SYNTAX: GLSL-PROGRAM:
|
||||
SYNTAX: \GLSL-PROGRAM:
|
||||
scan-new dup
|
||||
dup old-instances [
|
||||
f
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -139,4 +139,4 @@ SYNTAX: [infix
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: INFIX:: (INFIX::) define-declared ;
|
||||
SYNTAX: \INFIX:: (INFIX::) define-declared ;
|
||||
|
|
|
@ -109,7 +109,7 @@ PRIVATE>
|
|||
! SYNTAX: name string parameters ;
|
||||
! IRC: type "COMMAND" slot1 ...;
|
||||
! IRC: type "COMMAND" slot1 ... : trailing-slot;
|
||||
SYNTAX: IRC:
|
||||
SYNTAX: \IRC:
|
||||
scan-new-class
|
||||
[ scan-object register-irc-message-type ] keep
|
||||
";" parse-tokens
|
||||
|
|
|
@ -4,6 +4,6 @@ USING: accessors effects kernel lexer math.ranges parser
|
|||
sequences words ;
|
||||
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
|
||||
"derivative" set-word-prop ;
|
||||
|
|
|
@ -49,5 +49,5 @@ PRIVATE>
|
|||
: free-to-pool ( object -- )
|
||||
dup class-of class-pool pool-free ;
|
||||
|
||||
SYNTAX: POOL:
|
||||
SYNTAX: \POOL:
|
||||
scan-word scan-word '[ _ swap <pool> ] [ swap set-class-pool ] bi ;
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
USING: kernel generic generic.parser words fry ;
|
||||
IN: method-chains
|
||||
|
||||
SYNTAX: AFTER: (M:) dupd '[ [ _ (call-next-method) ] _ bi ] define ;
|
||||
SYNTAX: BEFORE: (M:) over '[ _ [ _ (call-next-method) ] bi ] define ;
|
||||
SYNTAX: \AFTER: (M:) dupd '[ [ _ (call-next-method) ] _ bi ] define ;
|
||||
SYNTAX: \BEFORE: (M:) over '[ _ [ _ (call-next-method) ] bi ] define ;
|
||||
|
|
|
@ -31,4 +31,4 @@ ERROR: not-an-integer x ;
|
|||
[ dup string>number [ ] [ not-an-integer ] ?if ] bi@
|
||||
] keep length 10^ / + swap [ neg ] when ;
|
||||
|
||||
SYNTAX: decimal: scan-token parse-decimal suffix! ;
|
||||
SYNTAX: \decimal: scan-token parse-decimal suffix! ;
|
||||
|
|
|
@ -9,7 +9,7 @@ FROM: mongodb.tuple.persistent => assoc>tuple ;
|
|||
|
||||
IN: mongodb.tuple
|
||||
|
||||
SYNTAX: MDBTUPLE:
|
||||
SYNTAX: \MDBTUPLE:
|
||||
parse-tuple-definition
|
||||
mdb-check-slots
|
||||
define-tuple-class ;
|
||||
|
|
|
@ -224,7 +224,7 @@ M: no-method error.
|
|||
] if ;
|
||||
|
||||
! 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-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 ;
|
||||
|
||||
SYNTAX: METHOD: (METHOD:) define ;
|
||||
SYNTAX: \METHOD: (METHOD:) define ;
|
||||
|
||||
! For compatibility
|
||||
SYNTAX: M:
|
||||
SYNTAX: \M:
|
||||
scan-word 1array scan-word create-method-in
|
||||
parse-definition
|
||||
define ;
|
||||
|
|
|
@ -4,5 +4,5 @@ USING: classes.parser classes.singleton classes.union kernel lexer
|
|||
sequences ;
|
||||
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 ;
|
||||
|
|
|
@ -39,7 +39,7 @@ ERROR: no-pair-method a b generic ;
|
|||
: (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 -- )
|
||||
[ 2array ] 2dip swap
|
||||
|
@ -54,4 +54,4 @@ SYNTAX: PAIR-GENERIC: (PAIR-GENERIC:) ;
|
|||
?swap scan-word parse-definition
|
||||
] keep ?prefix-swap define-pair-method ;
|
||||
|
||||
SYNTAX: PAIR-M: (PAIR-M:) ;
|
||||
SYNTAX: \PAIR-M: (PAIR-M:) ;
|
||||
|
|
|
@ -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" } "." }
|
||||
{ $examples
|
||||
{ $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\""
|
||||
}
|
||||
} ;
|
||||
|
|
|
@ -225,5 +225,5 @@ ERROR: bad-suit-symbol ch ;
|
|||
: string>hand-name ( string -- string' )
|
||||
string>value value>hand-name ;
|
||||
|
||||
SYNTAX: HAND{
|
||||
SYNTAX: \hand{
|
||||
"}" [ card> ] map-tokens suffix! ;
|
||||
|
|
|
@ -158,7 +158,7 @@ PRIVATE>
|
|||
: d-transform ( triple -- new-triple )
|
||||
{ { -1 -2 -2 } { 2 1 2 } { 2 2 3 } } transform ;
|
||||
|
||||
SYNTAX: SOLUTION:
|
||||
SYNTAX: \SOLUTION:
|
||||
scan-word
|
||||
[ name>> "-main" append create-word-in ] keep
|
||||
[ drop current-vocab main<< ]
|
||||
|
|
|
@ -61,12 +61,12 @@ SYMBOL: current-context
|
|||
|
||||
PRIVATE>
|
||||
|
||||
SYNTAX: PY-FROM: [
|
||||
SYNTAX: \PY-FROM: [
|
||||
current-context get f add-function
|
||||
] scan-definitions ; inline
|
||||
|
||||
SYNTAX: PY-QUALIFIED-FROM: [
|
||||
SYNTAX: \PY-QUALIFIED-FROM: [
|
||||
current-context get t add-function
|
||||
] scan-definitions ; inline
|
||||
|
||||
SYNTAX: PY-METHODS: [ add-method ] scan-definitions ; inline
|
||||
SYNTAX: \PY-METHODS: [ add-method ] scan-definitions ; inline
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
USING: lexer sequences parser ;
|
||||
IN: qw
|
||||
|
||||
SYNTAX: qw{ "}" parse-tokens suffix! ;
|
||||
SYNTAX: \qw{ "}" parse-tokens suffix! ;
|
||||
|
|
|
@ -64,5 +64,5 @@ PREDICATE: role < mixin-class
|
|||
[ roles>slots define-tuple-class ]
|
||||
[ drop [ role? ] filter add-to-roles ] 3tri ;
|
||||
|
||||
SYNTAX: ROLE: parse-role-definition define-role ;
|
||||
SYNTAX: ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ;
|
||||
SYNTAX: \ROLE: parse-role-definition define-role ;
|
||||
SYNTAX: \ROLE-TUPLE: parse-role-definition define-tuple-class-with-roles ;
|
||||
|
|
|
@ -113,7 +113,7 @@ TUPLE: slides < book ;
|
|||
: strip-tease ( data -- seq )
|
||||
first3 2 over length [a,b] [ head 3array ] with with with map ;
|
||||
|
||||
SYNTAX: STRIP-TEASE:
|
||||
SYNTAX: \STRIP-TEASE:
|
||||
parse-definition strip-tease append! ;
|
||||
|
||||
\ slides H{
|
||||
|
|
|
@ -4,11 +4,11 @@ USING: combinators combinators.smart fry kernel lexer quotations
|
|||
sequences sequences.generalizations slots words ;
|
||||
IN: slots.syntax
|
||||
|
||||
SYNTAX: slots[
|
||||
SYNTAX: \slots[
|
||||
"]" [ reader-word 1quotation ] map-tokens
|
||||
'[ _ cleave ] append! ;
|
||||
|
||||
SYNTAX: slots{
|
||||
SYNTAX: \slots{
|
||||
"}" [ reader-word 1quotation ] map-tokens
|
||||
'[ [ _ cleave ] output>array ] append! ;
|
||||
|
||||
|
@ -18,23 +18,23 @@ SYNTAX: slots{
|
|||
: writer-word<< ( name -- word )
|
||||
">>" prepend "accessors" lookup-word ;
|
||||
|
||||
SYNTAX: set-slots[
|
||||
SYNTAX: \set-slots[
|
||||
"]" [ >>writer-word 1quotation ] map-tokens
|
||||
'[ _ spread ] append! ;
|
||||
|
||||
SYNTAX: set-slots{
|
||||
SYNTAX: \set-slots{
|
||||
"}" [ >>writer-word 1quotation ] map-tokens
|
||||
[ length ] [ ] bi
|
||||
'[ _ firstn _ spread ] append! ;
|
||||
|
||||
SYNTAX: copy-slots{
|
||||
SYNTAX: \copy-slots{
|
||||
"}" [
|
||||
[ reader-word 1quotation ]
|
||||
[ writer-word<< 1quotation ] bi append
|
||||
] map-tokens
|
||||
'[ swap _ cleave ] append! ;
|
||||
|
||||
SYNTAX: get[ postpone: slots[ ;
|
||||
SYNTAX: get{ postpone: slots{ ;
|
||||
SYNTAX: set[ postpone: set-slots[ ;
|
||||
SYNTAX: set{ postpone: set-slots{ ;
|
||||
SYNTAX: \get[ postpone: slots[ ;
|
||||
SYNTAX: \get{ postpone: slots{ ;
|
||||
SYNTAX: \set[ postpone: set-slots[ ;
|
||||
SYNTAX: \set{ postpone: set-slots{ ;
|
||||
|
|
|
@ -25,4 +25,4 @@ SYMBOLS: unary binary keyword ;
|
|||
[ selector>effect ]
|
||||
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
Loading…
Reference in New Issue