From 2de1c21781f8d2e9dad1d75f9f600264c3070e48 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 28 Dec 2017 19:29:44 -0800 Subject: [PATCH] modern.paths: remove a ton of words --- extra/modern/paths/paths.factor | 57 +++++---------------------------- 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/extra/modern/paths/paths.factor b/extra/modern/paths/paths.factor index 14c52eca1e..d8f896e471 100644 --- a/extra/modern/paths/paths.factor +++ b/extra/modern/paths/paths.factor @@ -5,32 +5,7 @@ splitting vocabs.files vocabs.hierarchy vocabs.loader vocabs.metadata sets ; IN: modern.paths -: modern-if-available ( path -- path' ) - dup ".factor" ?tail [ - ".modern" append - dup exists? [ nip ] [ drop ] if - ] [ - drop - ] if ; - ERROR: not-a-source-path path ; -: force-modern-path ( path -- path' ) - ".factor" ?tail [ ".modern" append ] [ not-a-source-path ] if ; -: modern-docs-path ( path -- path' ) - vocab-docs-path modern-if-available ; -: modern-tests-path ( path -- path' ) - vocab-tests-path modern-if-available ; -: modern-source-path ( path -- path' ) - vocab-source-path modern-if-available ; -: modern-syntax-path ( path -- path' ) - vocab-source-path ".factor" ?tail drop "-syntax.modern" append ; - -: force-modern-docs-path ( path -- path' ) - vocab-docs-path force-modern-path ; -: force-modern-tests-path ( path -- path' ) - vocab-tests-path force-modern-path ; -: force-modern-source-path ( path -- path' ) - vocab-source-path force-modern-path ; : vocabs-from ( root -- vocabs ) "" disk-vocabs-in-root/prefix @@ -96,12 +71,11 @@ ERROR: not-a-source-path path ; [ ".modern" tail? ] reject ; : modern-source-paths ( names -- paths ) - [ modern-source-path ] map filter-exists reject-some-paths ; + [ vocab-source-path ] map filter-exists reject-some-paths ; : modern-docs-paths ( names -- paths ) - [ modern-docs-path ] map filter-exists reject-some-paths ; + [ vocab-docs-path ] map filter-exists reject-some-paths ; : modern-tests-paths ( names -- paths ) - [ vocab-tests ] map concat - [ modern-if-available ] map filter-exists reject-some-paths ; + [ vocab-tests ] map concat filter-exists reject-some-paths ; : all-source-paths ( -- seq ) all-vocabs modern-source-paths ; @@ -111,33 +85,18 @@ ERROR: not-a-source-path path ; : extra-docs-paths ( -- seq ) extra-vocabs modern-docs-paths ; : core-test-paths ( -- seq ) core-vocabs modern-tests-paths ; -: basis-test-paths ( -- seq ) - basis-vocabs - modern-tests-paths ; +: basis-test-paths ( -- seq ) basis-vocabs modern-tests-paths ; : extra-test-paths ( -- seq ) extra-vocabs modern-tests-paths ; -: all-docs-paths ( -- seq ) - all-vocabs modern-docs-paths ; +: all-docs-paths ( -- seq ) all-vocabs modern-docs-paths ; + : all-tests-paths ( -- seq ) all-vocabs modern-tests-paths ; -: all-tests-paths ( -- seq ) - all-vocabs modern-tests-paths ; - -: all-syntax-paths ( -- seq ) - all-vocabs [ modern-syntax-path ] map filter-exists reject-some-paths ; - -: all-factor-paths ( -- seq ) +: all-paths ( -- seq ) [ - all-syntax-paths all-source-paths all-docs-paths all-tests-paths + all-source-paths all-docs-paths all-tests-paths ] { } append-outputs-as ; -: vocab-names>syntax ( strings -- seq ) - [ modern-syntax-path ] map [ exists? ] filter ; - -: core-syntax-paths ( -- seq ) core-vocabs vocab-names>syntax reject-some-paths ; -: basis-syntax-paths ( -- seq ) basis-vocabs vocab-names>syntax reject-some-paths ; -: extra-syntax-paths ( -- seq ) extra-vocabs vocab-names>syntax reject-some-paths ; - : core-source-paths ( -- seq ) core-vocabs modern-source-paths reject-some-paths ; : basis-source-paths ( -- seq )