Fix tree shaker issue
parent
47c91e379e
commit
189a9323cd
|
@ -333,12 +333,14 @@ HELP: CREATE
|
||||||
{ $errors "Throws an error if the end of the line is reached." }
|
{ $errors "Throws an error if the end of the line is reached." }
|
||||||
$parsing-note ;
|
$parsing-note ;
|
||||||
|
|
||||||
HELP: no-word
|
HELP: no-word-error
|
||||||
{ $values { "name" string } { "newword" word } }
|
|
||||||
{ $description "Throws a " { $link no-word } " error." }
|
|
||||||
{ $error-description "Thrown if the parser encounters a token which does not name a word in the current vocabulary search path. If any words with this name exist in vocabularies not part of the search path, a number of restarts will offer to add those vocabularies to the search path and use the chosen word." }
|
{ $error-description "Thrown if the parser encounters a token which does not name a word in the current vocabulary search path. If any words with this name exist in vocabularies not part of the search path, a number of restarts will offer to add those vocabularies to the search path and use the chosen word." }
|
||||||
{ $notes "Apart from a missing " { $link POSTPONE: USE: } ", this error can also indicate an ordering issue. In Factor, words must be defined before they can be called. Mutual recursion can be implemented via " { $link POSTPONE: DEFER: } "." } ;
|
{ $notes "Apart from a missing " { $link POSTPONE: USE: } ", this error can also indicate an ordering issue. In Factor, words must be defined before they can be called. Mutual recursion can be implemented via " { $link POSTPONE: DEFER: } "." } ;
|
||||||
|
|
||||||
|
HELP: no-word
|
||||||
|
{ $values { "name" string } { "newword" word } }
|
||||||
|
{ $description "Throws a " { $link no-word-error } "." } ;
|
||||||
|
|
||||||
HELP: search
|
HELP: search
|
||||||
{ $values { "str" string } { "word/f" "a word or " { $link f } } }
|
{ $values { "str" string } { "word/f" "a word or " { $link f } } }
|
||||||
{ $description "Searches for a word by name in the current vocabulary search path. If no such word could be found, outputs " { $link f } "." }
|
{ $description "Searches for a word by name in the current vocabulary search path. If no such word could be found, outputs " { $link f } "." }
|
||||||
|
|
|
@ -252,13 +252,13 @@ PREDICATE: unexpected-eof < unexpected
|
||||||
[ "Use the word " swap summary append ] keep
|
[ "Use the word " swap summary append ] keep
|
||||||
] { } map>assoc ;
|
] { } map>assoc ;
|
||||||
|
|
||||||
TUPLE: no-word name ;
|
ERROR: no-word-error name ;
|
||||||
|
|
||||||
M: no-word summary
|
M: no-word-error summary
|
||||||
drop "Word not found in current vocabulary search path" ;
|
drop "Word not found in current vocabulary search path" ;
|
||||||
|
|
||||||
: no-word ( name -- newword )
|
: no-word ( name -- newword )
|
||||||
dup \ no-word construct-boa
|
dup no-word-error construct-boa
|
||||||
swap words-named [ forward-reference? not ] subset
|
swap words-named [ forward-reference? not ] subset
|
||||||
word-restarts throw-restarts
|
word-restarts throw-restarts
|
||||||
dup word-vocabulary (use+) ;
|
dup word-vocabulary (use+) ;
|
||||||
|
|
Loading…
Reference in New Issue