120 void print_args (FILE* fp, const list<format_arg>& args) |
121 void print_args (FILE* fp, const list<format_arg>& args) |
121 { |
122 { |
122 string out = format_args (args); |
123 string out = format_args (args); |
123 fprintf (fp, "%s", out.chars()); |
124 fprintf (fp, "%s", out.chars()); |
124 } |
125 } |
|
126 |
|
127 void do_error (string msg) |
|
128 { |
|
129 lexer* lx = lexer::get_main_lexer(); |
|
130 string fileinfo; |
|
131 |
|
132 if (lx != null && lx->has_valid_token()) |
|
133 { |
|
134 lexer::token* tk = lx->get_token(); |
|
135 fileinfo = format ("%1:%2:%3: ", tk->file, tk->line, tk->column); |
|
136 } |
|
137 |
|
138 throw script_error (fileinfo + msg); |
|
139 } |