File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,15 @@ struct comment
104
104
//
105
105
struct error
106
106
{
107
+ // Controls whether we print `FILE:line:col: error:` or `FILE(line,col):
108
+ // error:`. Need to integrate with editors that jump to errors, etc.
109
+ // TODO: This should become a compiler flag.
110
+ #ifdef _MSC_VER
111
+ static constexpr bool print_colon_errors = false ;
112
+ #else
113
+ static constexpr bool print_colon_errors = true ;
114
+ #endif
115
+
107
116
source_position where;
108
117
std::string msg;
109
118
bool internal = false ;
@@ -116,11 +125,19 @@ struct error
116
125
{
117
126
o << file ;
118
127
if (where.lineno > 0 ) {
119
- o << " (" << (where.lineno );
120
- if (where.colno >= 0 ) {
121
- o << " ," << where.colno ;
128
+ if (print_colon_errors) {
129
+ o << " :" << (where.lineno );
130
+ if (where.colno >= 0 ) {
131
+ o << " :" << where.colno ;
132
+ }
133
+ }
134
+ else {
135
+ o << " (" << (where.lineno );
136
+ if (where.colno >= 0 ) {
137
+ o << " ," << where.colno ;
138
+ }
139
+ o << " )" ;
122
140
}
123
- o << " )" ;
124
141
}
125
142
o << " :" ;
126
143
if (internal) {
You can’t perform that action at this time.
0 commit comments