| 
									
										
										
										
											2009-04-09 05:50:38 -04:00
										 |  |  | ! Copyright (C) 2009 Slava Pestov. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2009-04-15 01:27:02 -04:00
										 |  |  | USING: assocs debugger io kernel sequences source-files.errors | 
					
						
							| 
									
										
										
										
											2009-04-18 04:21:31 -04:00
										 |  |  | summary accessors continuations make math.parser io.styles namespaces | 
					
						
							| 
									
										
										
										
											2011-12-07 13:52:58 -05:00
										 |  |  | compiler.errors prettyprint source-files.errors.debugger command-line ;
 | 
					
						
							| 
									
										
										
										
											2009-04-09 05:50:38 -04:00
										 |  |  | IN: tools.errors | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #! Tools for source-files.errors. Used by tools.tests and others | 
					
						
							|  |  |  | #! for error reporting | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : errors. ( errors -- )
 | 
					
						
							|  |  |  |     group-by-source-file sort-errors | 
					
						
							|  |  |  |     [ | 
					
						
							| 
									
										
										
										
											2009-04-22 11:46:50 -04:00
										 |  |  |         [ nl "==== " write +listener-input+ or print nl ] | 
					
						
							| 
									
										
										
										
											2009-04-09 05:50:38 -04:00
										 |  |  |         [ [ nl ] [ error. ] interleave ] | 
					
						
							|  |  |  |         bi*
 | 
					
						
							|  |  |  |     ] assoc-each ;
 | 
					
						
							| 
									
										
										
										
											2009-04-18 04:21:31 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | : :errors ( -- ) compiler-errors get values errors. ;
 | 
					
						
							| 
									
										
										
										
											2009-04-18 04:21:31 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-23 23:17:25 -04:00
										 |  |  | : :linkage ( -- ) linkage-errors get values errors. ;
 | 
					
						
							| 
									
										
										
										
											2009-04-20 23:05:41 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-07 13:52:58 -05:00
										 |  |  | : :user-init-errors ( -- )
 | 
					
						
							|  |  |  |     user-init-errors get-global values errors. ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-20 23:05:41 -04:00
										 |  |  | M: not-compiled summary | 
					
						
							|  |  |  |     word>> name>> "The word " " cannot be executed because it failed to compile" surround ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: not-compiled error. | 
					
						
							| 
									
										
										
										
											2011-11-15 21:26:17 -05:00
										 |  |  |     [ summary print nl ] [ error>> error. ] bi ;
 |