src/format.cc

changeset 82
841562f5a32f
parent 81
071715c17296
child 85
264a61e9eba0
equal deleted inserted replaced
81:071715c17296 82:841562f5a32f
31 #include <cstdio> 31 #include <cstdio>
32 #include "main.h" 32 #include "main.h"
33 #include "format.h" 33 #include "format.h"
34 #include "lexer.h" 34 #include "lexer.h"
35 35
36 // =============================================================================
37 //
36 static void draw_pos (const string& fmt, int pos) 38 static void draw_pos (const string& fmt, int pos)
37 { 39 {
38 string rep (fmt); 40 string rep (fmt);
39 rep.replace ("\n", "↵"); 41 rep.replace ("\n", "↵");
40 rep.replace ("\t", "⇥"); 42 rep.replace ("\t", "⇥");
109 } 111 }
110 112
111 return fmt; 113 return fmt;
112 } 114 }
113 115
116 // =============================================================================
117 //
114 void print_args (FILE* fp, const list<format_arg>& args) 118 void print_args (FILE* fp, const list<format_arg>& args)
115 { 119 {
116 string out = format_args (args); 120 string out = format_args (args);
117 fprintf (fp, "%s", out.chars()); 121 fprintf (fp, "%s", out.chars());
118 } 122 }
119 123
124 // =============================================================================
125 //
120 void do_error (string msg) 126 void do_error (string msg)
121 { 127 {
122 lexer* lx = lexer::get_main_lexer(); 128 lexer* lx = lexer::get_main_lexer();
123 string fileinfo; 129 string fileinfo;
124 130

mercurial