basis/,extra/: using parse-array-def in a bunch of places
parent
1c53e43768
commit
0142d0b078
|
@ -7,14 +7,14 @@ IN: help.syntax
|
|||
SYNTAX: HELP:
|
||||
scan-word bootstrap-word
|
||||
[ >link save-location ]
|
||||
[ [ \ ; parse-until >array ] dip set-word-help ]
|
||||
[ [ parse-array-def ] dip set-word-help ]
|
||||
bi ;
|
||||
|
||||
ERROR: article-expects-name-and-title got ;
|
||||
|
||||
SYNTAX: ARTICLE:
|
||||
location [
|
||||
\ ; parse-until >array
|
||||
parse-array-def
|
||||
dup length 2 < [ article-expects-name-and-title ] when
|
||||
[ first2 ] [ 2 tail ] bi <article>
|
||||
over add-article >link
|
||||
|
|
|
@ -30,7 +30,12 @@ TIP: "Use the " { $link leaks. } " combinator to track down resource leaks." ;
|
|||
HELP: TIP:
|
||||
{ $syntax "TIP: content ;" }
|
||||
{ $values { "content" "a markup element" } }
|
||||
{ $description "Defines a new tip of the day." } ;
|
||||
{ $description "Defines a new tip of the day." }
|
||||
{ $examples
|
||||
{ $unchecked-example
|
||||
"TIP: \"Factor is a fun programming language.\" ;"
|
||||
}
|
||||
} ;
|
||||
|
||||
ARTICLE: "all-tips-of-the-day" "All tips of the day"
|
||||
{ $tips-of-the-day } ;
|
||||
|
|
|
@ -22,7 +22,7 @@ M: tip set-where loc<< ;
|
|||
: add-tip ( tip -- ) tips get push ;
|
||||
|
||||
SYNTAX: TIP:
|
||||
parse-definition >array <tip>
|
||||
parse-array-def <tip>
|
||||
[ save-location ] [ add-tip ] bi ;
|
||||
|
||||
: a-tip ( -- tip ) tips get random ;
|
||||
|
|
|
@ -105,6 +105,11 @@ M: a-union test-generic ;
|
|||
|
||||
{ f } [ "fast-union-2?" "classes.union.tests" lookup-word def>> \ fixnum-bitand swap member? ] unit-test
|
||||
|
||||
{ { fixnum } } [
|
||||
"IN: classes.union.tests USE: math UNION: um fixnum ;" eval( -- )
|
||||
"um" "classes.union.tests" lookup-word "members" word-prop
|
||||
] unit-test
|
||||
|
||||
! Test union{
|
||||
|
||||
TUPLE: stuff { a union{ integer string } } ;
|
||||
|
|
|
@ -180,11 +180,11 @@ IN: bootstrap.syntax
|
|||
] define-core-syntax
|
||||
|
||||
"UNION:" [
|
||||
scan-new-class parse-definition define-union-class
|
||||
scan-new-class parse-array-def define-union-class
|
||||
] define-core-syntax
|
||||
|
||||
"INTERSECTION:" [
|
||||
scan-new-class parse-definition define-intersection-class
|
||||
scan-new-class parse-array-def define-intersection-class
|
||||
] define-core-syntax
|
||||
|
||||
"MIXIN:" [
|
||||
|
|
|
@ -505,10 +505,10 @@ DEFER: [bind-uniform-tuple]
|
|||
: parse-uniform-tuple-definition ( -- class superclass uniforms )
|
||||
scan-new-class scan-token {
|
||||
{ ";" [ uniform-tuple f ] }
|
||||
{ "<" [ scan-word parse-definition [ first3 uniform boa ] map ] }
|
||||
{ "<" [ scan-word parse-array-def [ first3 uniform boa ] map ] }
|
||||
{ "{" [
|
||||
uniform-tuple
|
||||
\ } parse-until parse-definition swap prefix
|
||||
\ } parse-until parse-array-def swap prefix
|
||||
[ first3 uniform boa ] map
|
||||
] }
|
||||
} case ;
|
||||
|
|
|
@ -614,7 +614,7 @@ SYNTAX: GLSL-PROGRAM:
|
|||
dup old-instances [
|
||||
f
|
||||
lexer get line>>
|
||||
\ ; parse-until >array shaders-and-formats
|
||||
parse-array-def shaders-and-formats
|
||||
] dip
|
||||
program boa
|
||||
over reset-generic
|
||||
|
|
Loading…
Reference in New Issue