From 0142d0b0781e098b7adf33eaa8cad02516ee1f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sat, 3 Dec 2016 13:16:08 +0100 Subject: [PATCH] basis/,extra/: using parse-array-def in a bunch of places --- basis/help/syntax/syntax.factor | 4 ++-- basis/help/tips/tips-docs.factor | 7 ++++++- basis/help/tips/tips.factor | 2 +- core/classes/union/union-tests.factor | 5 +++++ core/syntax/syntax.factor | 4 ++-- extra/gpu/render/render.factor | 4 ++-- extra/gpu/shaders/shaders.factor | 2 +- 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/basis/help/syntax/syntax.factor b/basis/help/syntax/syntax.factor index 74c14e1f87..73f72e7b22 100644 --- a/basis/help/syntax/syntax.factor +++ b/basis/help/syntax/syntax.factor @@ -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
over add-article >link diff --git a/basis/help/tips/tips-docs.factor b/basis/help/tips/tips-docs.factor index 1320e7b95c..17890c1a33 100644 --- a/basis/help/tips/tips-docs.factor +++ b/basis/help/tips/tips-docs.factor @@ -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 } ; diff --git a/basis/help/tips/tips.factor b/basis/help/tips/tips.factor index d85aca9aba..1b535d8dfa 100644 --- a/basis/help/tips/tips.factor +++ b/basis/help/tips/tips.factor @@ -22,7 +22,7 @@ M: tip set-where loc<< ; : add-tip ( tip -- ) tips get push ; SYNTAX: TIP: - parse-definition >array + parse-array-def [ save-location ] [ add-tip ] bi ; : a-tip ( -- tip ) tips get random ; diff --git a/core/classes/union/union-tests.factor b/core/classes/union/union-tests.factor index f08cde6cda..1497c1521a 100644 --- a/core/classes/union/union-tests.factor +++ b/core/classes/union/union-tests.factor @@ -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 } } ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index ab760813fc..a0908b7040 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -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:" [ diff --git a/extra/gpu/render/render.factor b/extra/gpu/render/render.factor index f157e322a8..6e4564e06c 100755 --- a/extra/gpu/render/render.factor +++ b/extra/gpu/render/render.factor @@ -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 ; diff --git a/extra/gpu/shaders/shaders.factor b/extra/gpu/shaders/shaders.factor index 8dac18ca70..b677d1b763 100755 --- a/extra/gpu/shaders/shaders.factor +++ b/extra/gpu/shaders/shaders.factor @@ -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