From c7a84b796feb3a023878e94d0c0e508494956b6c Mon Sep 17 00:00:00 2001 From: slava Date: Sun, 17 Dec 2006 21:28:41 +0000 Subject: [PATCH] Auto-generate error index in handbook --- TODO.txt | 1 - core/handbook/handbook.facts | 39 +----------------------------------- core/help/topics.factor | 6 ++++++ 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/TODO.txt b/TODO.txt index 9181bedbfd..07432dffaa 100644 --- a/TODO.txt +++ b/TODO.txt @@ -4,7 +4,6 @@ - error popup obscures input area - ui docs - test factor on linux/ppc -- auto-generate error-index + 0.88: diff --git a/core/handbook/handbook.facts b/core/handbook/handbook.facts index 1e54c84307..4ea3ad256e 100644 --- a/core/handbook/handbook.facts +++ b/core/handbook/handbook.facts @@ -66,44 +66,7 @@ ARTICLE: "primitive-index" "Primitive index" { $outliner [ all-words [ primitive? ] subset ] } ; ARTICLE: "error-index" "Error index" -{ $subsection alien-callback-error } -{ $subsection alien-invoke-error } -{ $subsection assert } -{ $subsection bad-escape } -{ $subsection bounds-error } -{ $subsection c-stream-error } -{ $subsection c-string-error. } -{ $subsection callstack-overflow. } -{ $subsection check-closed } -{ $subsection check-create } -{ $subsection check-method } -{ $subsection check-ptr } -{ $subsection check-tuple } -{ $subsection check-vocab } -{ $subsection condition } -{ $subsection datastack-overflow. } -{ $subsection datastack-underflow. } -{ $subsection divide-by-zero-error. } -{ $subsection empty-queue } -{ $subsection expired-error. } -{ $subsection ffi-error. } -{ $subsection heap-scan-error. } -{ $subsection inference-error } -{ $subsection io-error. } -{ $subsection negative-array-size-error. } -{ $subsection no-article } -{ $subsection no-cond } -{ $subsection no-math-method } -{ $subsection no-method } -{ $subsection parse-error } -{ $subsection retainstack-overflow. } -{ $subsection retainstack-underflow. } -{ $subsection signal-error. } -{ $subsection slice-error } -{ $subsection type-check-error. } -{ $subsection undefined-symbol-error. } -{ $subsection undefined-word-error. } -{ $subsection user-interrupt. } ; +{ $outliner [ all-errors ] } ; ARTICLE: "type-index" "Type index" { $outliner [ builtins get [ ] subset ] } ; diff --git a/core/help/topics.factor b/core/help/topics.factor index fda7892e0f..32645c4cdc 100644 --- a/core/help/topics.factor +++ b/core/help/topics.factor @@ -35,6 +35,12 @@ M: f article-content drop \ f article-content ; articles get hash-keys all-words [ word-help ] subset append ; +: error? ( word -- ? ) + \ $error-description swap word-help elements empty? not ; + +: all-errors ( -- seq ) + all-words [ error? ] subset natural-sort ; + GENERIC: elements* ( elt-type element -- ) : elements ( elt-type element -- seq ) [ elements* ] { } make ;