]> gitweb.factorcode.org Git - factor.git/commitdiff
Auto-generate error index in handbook
authorslava <slava@factorcode.org>
Sun, 17 Dec 2006 21:28:41 +0000 (21:28 +0000)
committerslava <slava@factorcode.org>
Sun, 17 Dec 2006 21:28:41 +0000 (21:28 +0000)
TODO.txt
core/handbook/handbook.facts
core/help/topics.factor

index 9181bedbfd7bc40a7141e704c8ef4b4685611bd2..07432dffaa201806c68b030fc047f8cbf8956293 100644 (file)
--- 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:
 
index 1e54c843078ca530e5389c33225f743bf6b3eff3..4ea3ad256e8fe7d828c5f3848a0c1fb9987b86af 100644 (file)
@@ -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 ] } ;
index fda7892e0f6124b66a9b7c0823d5ff470fa016b8..32645c4cdced907230676c67e32af3ef76180757 100644 (file)
@@ -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 ;