| 
									
										
										
										
											2009-03-28 05:19:02 -04:00
										 |  |  | ! Copyright (C) 2007, 2009 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2007-12-28 22:51:36 -05:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | USING: accessors source-files.errors kernel namespaces assocs fry | 
					
						
							|  |  |  | summary ;
 | 
					
						
							| 
									
										
										
										
											2007-12-28 22:51:36 -05:00
										 |  |  | IN: compiler.errors | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | SYMBOL: +compiler-error+ | 
					
						
							|  |  |  | SYMBOL: compiler-errors | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | compiler-errors [ H{ } clone ] initialize
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-10 04:52:12 -04:00
										 |  |  | TUPLE: compiler-error < source-file-error ;
 | 
					
						
							| 
									
										
										
										
											2009-03-28 05:19:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | M: compiler-error error-type drop +compiler-error+ ;
 | 
					
						
							| 
									
										
										
										
											2009-03-28 05:19:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | SYMBOL: +linkage-error+ | 
					
						
							|  |  |  | SYMBOL: linkage-errors | 
					
						
							| 
									
										
										
										
											2007-12-28 22:51:36 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | linkage-errors [ H{ } clone ] initialize
 | 
					
						
							| 
									
										
										
										
											2009-03-28 05:19:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | TUPLE: linkage-error < source-file-error ;
 | 
					
						
							| 
									
										
										
										
											2009-04-11 23:26:24 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | M: linkage-error error-type drop +linkage-error+ ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : clear-compiler-error ( word -- )
 | 
					
						
							|  |  |  |     compiler-errors linkage-errors | 
					
						
							|  |  |  |     [ get-global delete-at ] bi-curry@ bi ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : compiler-error ( error -- )
 | 
					
						
							|  |  |  |     dup asset>> compiler-errors get-global set-at ;
 | 
					
						
							| 
									
										
										
										
											2007-12-28 22:51:36 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-12 17:08:46 -04:00
										 |  |  | T{ error-type | 
					
						
							|  |  |  |    { type +compiler-error+ } | 
					
						
							|  |  |  |    { word ":errors" } | 
					
						
							|  |  |  |    { plural "compiler errors" } | 
					
						
							|  |  |  |    { icon "vocab:ui/tools/error-list/icons/compiler-error.tiff" } | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  |    { quot [ compiler-errors get values ] } | 
					
						
							| 
									
										
										
										
											2009-04-15 01:27:02 -04:00
										 |  |  |    { forget-quot [ compiler-errors get delete-at ] } | 
					
						
							| 
									
										
										
										
											2009-04-12 17:08:46 -04:00
										 |  |  | } define-error-type | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | : <compiler-error> ( error word -- compiler-error )
 | 
					
						
							|  |  |  |     \ compiler-error <definition-error> ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : <linkage-error> ( error word -- linkage-error )
 | 
					
						
							|  |  |  |     \ linkage-error <definition-error> ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : linkage-error ( error word class -- )
 | 
					
						
							|  |  |  |     '[ _ boa ] dip <linkage-error> dup asset>> linkage-errors get set-at ; inline
 | 
					
						
							| 
									
										
										
										
											2009-04-12 17:08:46 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | T{ error-type | 
					
						
							|  |  |  |    { type +linkage-error+ } | 
					
						
							|  |  |  |    { word ":linkage" } | 
					
						
							|  |  |  |    { plural "linkage errors" } | 
					
						
							|  |  |  |    { icon "vocab:ui/tools/error-list/icons/linkage-error.tiff" } | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  |    { quot [ linkage-errors get values ] } | 
					
						
							|  |  |  |    { forget-quot [ linkage-errors get delete-at ] } | 
					
						
							| 
									
										
										
										
											2009-04-17 17:16:12 -04:00
										 |  |  |    { fatal? f } | 
					
						
							| 
									
										
										
										
											2009-04-12 17:08:46 -04:00
										 |  |  | } define-error-type | 
					
						
							| 
									
										
										
										
											2008-02-10 21:32:48 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | TUPLE: no-such-library name ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: no-such-library summary drop "Library not found" ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : no-such-library ( name word -- ) \ no-such-library linkage-error ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TUPLE: no-such-symbol name ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: no-such-symbol summary drop "Symbol not found" ;
 | 
					
						
							| 
									
										
										
										
											2009-03-28 05:19:02 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | : no-such-symbol ( name word -- ) \ no-such-symbol linkage-error ;
 | 
					
						
							| 
									
										
										
										
											2009-04-20 23:05:41 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ERROR: not-compiled word error ;
 |