src/main.cc

changeset 79
2425fa6a4f21
parent 77
ad17801b1a36
child 82
841562f5a32f
equal deleted inserted replaced
78:e6d7e32e6481 79:2425fa6a4f21
186 // Done! 186 // Done!
187 exit (0); 187 exit (0);
188 } 188 }
189 catch (script_error& e) 189 catch (script_error& e)
190 { 190 {
191 lexer* lx = lexer::get_main_lexer(); 191 fprint (stderr, "error: %1\n", e.what());
192 string fileinfo;
193
194 if (lx != null && lx->has_valid_token())
195 {
196 lexer::token* tk = lx->get_token();
197 fileinfo = format ("%1:%2:%3: ", tk->file, tk->line, tk->column);
198 }
199
200 fprint (stderr, "%1error: %2\n", fileinfo, e.what());
201 } 192 }
202 } 193 }
203 194
204 // ============================================================================ 195 // ============================================================================
205 // Utility functions 196 // Utility functions

mercurial