From aadb5d0b7028062d0e9f90334747465a38e026a4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 30 Jun 2015 09:46:36 -0700 Subject: [PATCH] help.syntax: Don't throw a sequence error when article is defined poorly. --- basis/help/syntax/syntax.factor | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/basis/help/syntax/syntax.factor b/basis/help/syntax/syntax.factor index eac8bc93f8..74c14e1f87 100644 --- a/basis/help/syntax/syntax.factor +++ b/basis/help/syntax/syntax.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays compiler.units definitions effects -effects.parser help help.topics kernel namespaces parser -sequences vocabs vocabs.parser words ; +USING: accessors arrays compiler.units definitions help +help.topics kernel math parser sequences vocabs.parser words ; IN: help.syntax SYNTAX: HELP: @@ -11,9 +10,13 @@ SYNTAX: HELP: [ [ \ ; parse-until >array ] dip set-word-help ] bi ; +ERROR: article-expects-name-and-title got ; + SYNTAX: ARTICLE: location [ - \ ; parse-until >array [ first2 ] [ 2 tail ] bi
+ \ ; parse-until >array + dup length 2 < [ article-expects-name-and-title ] when + [ first2 ] [ 2 tail ] bi
over add-article >link ] dip remember-definition ;