]> gitweb.factorcode.org Git - factor.git/commitdiff
source-files.errors: rename <definition-error> to new-source-file-error.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Oct 2017 17:45:46 +0000 (10:45 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 25 Oct 2017 17:45:46 +0000 (10:45 -0700)
basis/compiler/errors/errors.factor
basis/help/lint/lint.factor
basis/tools/deprecation/deprecation.factor
basis/tools/errors/errors-docs.factor
core/source-files/errors/errors-docs.factor
core/source-files/errors/errors.factor

index 2c61621762fea351df959359eeda51ea096780a1..41c2af320f83176764f45d1a0c688c3c1167d7b0 100644 (file)
@@ -39,10 +39,10 @@ T{ error-type-holder
 } define-error-type
 
 : <compiler-error> ( error word -- compiler-error )
-    \ compiler-error <definition-error> ;
+    compiler-error new-source-file-error ;
 
 : <linkage-error> ( error word -- linkage-error )
-    \ linkage-error <definition-error> ;
+    linkage-error new-source-file-error ;
 
 : set-linkage-error ( name message word class -- )
     '[ _ boa ] dip <linkage-error> dup asset>> linkage-errors get set-at ; inline
index 66988df5aabee2d07932df9d43b338d3abd1eaef..95a2f7e0d03ca85010c3cea1f003585587c62a35 100644 (file)
@@ -28,7 +28,7 @@ M: help-lint-error error-type drop +help-lint-failure+ ;
 <PRIVATE
 
 : <help-lint-error> ( error topic -- help-lint-error )
-    \ help-lint-error <definition-error> ;
+    help-lint-error new-source-file-error ;
 
 PRIVATE>
 
index de7fbbb1ccf003b9e636bcf2ed5c58ee9f1e539b..7b748eaded7d79c1e5503c9a63837162175d9c9f 100644 (file)
@@ -12,9 +12,9 @@ SYMBOL: deprecation-notes
 
 deprecation-notes [ H{ } clone ] initialize
 
-TUPLE: deprecation-note-error < source-file-error ;
+TUPLE: deprecation-note < source-file-error ;
 
-M: deprecation-note-error error-type drop +deprecation-note+ ;
+M: deprecation-note error-type drop +deprecation-note+ ;
 
 TUPLE: deprecated-usages asset usages ;
 
@@ -31,13 +31,13 @@ T{ error-type-holder
     { fatal? f }
 } define-error-type
 
-: <deprecation-note-error> ( error word -- deprecation-note )
-    \ deprecation-note-error <definition-error> ;
+: <deprecation-note> ( error word -- deprecation-note )
+    deprecation-note new-source-file-error ;
 
-: deprecation-note ( word usages -- )
-    [ deprecated-usages boa ]
-    [ drop <deprecation-note-error> ]
-    [ drop deprecation-notes get-global set-at ] 2tri ;
+: store-deprecation-note ( word usages -- )
+    over [ deprecated-usages boa ] dip
+    [ <deprecation-note> ]
+    [ deprecation-notes get-global set-at ] bi ;
 
 : clear-deprecation-note ( word -- )
     deprecation-notes get-global delete-at ;
@@ -47,7 +47,8 @@ T{ error-type-holder
         dup { [ "forgotten" word-prop ] [ deprecated? ] } 1||
         [ clear-deprecation-note ] [
             dup def>> uses [ deprecated? ] filter
-            [ clear-deprecation-note ] [ >array deprecation-note ] if-empty
+            [ clear-deprecation-note ]
+            [ store-deprecation-note ] if-empty
         ] if
     ] [ drop ] if ;
 
@@ -74,7 +75,7 @@ M: deprecation-observer definitions-changed
     [ [ check-deprecations ] each ]
     [ drop initialize-deprecation-notes ] if ;
 
-[ deprecation-observer add-definition-observer ]
+[ deprecation-observer add-definition-observer ]
 "tools.deprecation" add-startup-hook
 
 initialize-deprecation-notes
index f52a2c5c1313de1d105832361ebddfff434578f9..25f417fa13bd161925eb21ee055e873e4e3b04e4 100644 (file)
@@ -33,7 +33,7 @@ HELP: :linkage
 { :errors :linkage } related-words
 
 HELP: errors.
-{ $values { "errors" "a sequence of " { $link source-file-error } " instances" } }
+{ $values { "errors" { $sequence source-file-error } } }
 { $description "Prints a list of errors, grouped by source file." } ;
 
 ARTICLE: "tools.errors" "Batch error reporting"
index 17d0094d541f1b8ff15699d774c3cb87d563fa34..086f814d69a71ef50e1c021c3e07b25985594040 100644 (file)
@@ -32,11 +32,11 @@ HELP: error-file
 { $values { "error" "an error" } { "file" "a file path" } }
 { $description "File in which the error occurred." } ;
 
-HELP: <definition-error>
+HELP: new-source-file-error
 { $values
-  { "error" "an error." }
-  { "definition" "an asset that contains the error." }
-  { "class" "a tuple class deriving source-file-error." }
+  { "error" "an error" }
+  { "asset" "an asset that contains the error" }
+  { "class" "a tuple class deriving source-file-error" }
   { "source-file-error" source-file-error }
 }
 { $description "Creates a new " { $link source-file-error } " instance." } ;
index 494fc651cf3068fa2ace4b765b4d97308ca61ec7..fd790dcb4c6166d6b6646cf43ef2c609dd72f6a3 100644 (file)
@@ -19,6 +19,13 @@ M: source-file-error error-file [ error>> error-file ] [ path>> ] bi or ;
 M: source-file-error error-line [ error>> error-line ] [ line#>> ] bi or ;
 M: source-file-error compute-restarts error>> compute-restarts ;
 
+: new-source-file-error ( error asset class -- source-file-error )
+    new
+        swap
+        [ >>asset ]
+        [ where [ first2 [ >>path ] [ >>line# ] bi* ] when* ] bi
+        swap >>error ; inline
+
 : sort-errors ( errors -- alist )
     [ [ line#>> 0 or ] sort-with ] { } assoc-map-as sort-keys ;
 
@@ -29,13 +36,6 @@ TUPLE: error-type-holder type word plural icon quot forget-quot { fatal? initial
 
 GENERIC: error-type ( error -- type )
 
-: <definition-error> ( error definition class -- source-file-error )
-    new
-        swap
-        [ >>asset ]
-        [ where [ first2 [ >>path ] [ >>line# ] bi* ] when* ] bi
-        swap >>error ; inline
-
 SYMBOL: error-types
 
 error-types [ V{ } clone ] initialize