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