Fix scaffold to work with vocab-roots outside of Factor source tree. Cleanup check-vocab-root.
parent
869d4cea78
commit
e609448b44
|
@ -19,21 +19,15 @@ ERROR: no-vocab vocab ;
|
||||||
|
|
||||||
: root? ( string -- ? ) vocab-roots get member? ;
|
: root? ( string -- ? ) vocab-roots get member? ;
|
||||||
|
|
||||||
: length-changes? ( seq quot -- ? )
|
: contains-dot? ( string -- ? ) ".." swap subseq? ;
|
||||||
dupd call [ length ] bi@ = not ; inline
|
|
||||||
|
: contains-separator? ( string -- ? ) [ path-separator? ] contains? ;
|
||||||
|
|
||||||
: check-vocab-name ( string -- string )
|
: check-vocab-name ( string -- string )
|
||||||
dup [ [ CHAR: . = ] trim ] length-changes?
|
dup contains-dot? [ vocab-name-contains-dot ] when
|
||||||
[ vocab-name-contains-dot ] when
|
dup contains-separator? [ vocab-name-contains-separator ] when ;
|
||||||
|
|
||||||
".." over subseq? [ vocab-name-contains-dot ] when
|
|
||||||
|
|
||||||
dup [ path-separator? ] contains?
|
|
||||||
[ vocab-name-contains-separator ] when ;
|
|
||||||
|
|
||||||
: check-root ( string -- string )
|
: check-root ( string -- string )
|
||||||
check-vocab-name
|
|
||||||
dup "resource:" head? [ "resource:" prepend ] unless
|
|
||||||
dup root? [ not-a-vocab-root ] unless ;
|
dup root? [ not-a-vocab-root ] unless ;
|
||||||
|
|
||||||
: directory-exists ( path -- )
|
: directory-exists ( path -- )
|
||||||
|
|
Loading…
Reference in New Issue