You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (line.cat == source_line::category::preprocessor) {
1258
+
if (!line.text.ends_with(".h2\"")) {
1259
+
errors.emplace_back(
1260
+
source_position(curr_lineno, 1),
1261
+
"pure-cpp2 switch disables the preprocessor, including #include (except of .h2 files) - use import instead (note: 'import std;' is implicit in -pure-cpp2)"
1262
+
);
1263
+
returnfalse;
1264
+
}
1265
+
}
1266
+
else {
1267
+
errors.emplace_back(
1268
+
source_position(curr_lineno, 1),
1269
+
"pure-cpp2 switch disables Cpp1 syntax"
1270
+
);
1271
+
returnfalse;
1272
+
}
1273
+
}
1274
+
1275
+
if (
1276
+
line.cat == source_line::category::preprocessor
1277
+
&& line.text.ends_with(".h2\"")
1278
+
)
1279
+
{
1280
+
// Strip off the 2"
1281
+
auto h_include = line.text.substr(0, line.text.size()-2);
for (autoconst& line : source.get_non_module_lines())
1307
1406
{
1308
1407
// Skip dummy line we added to make 0-vs-1-based offsets readable
1309
1408
if (curr_lineno != 0)
1310
1409
{
1311
1410
// If it's a Cpp1 line, emit it
1312
-
if (line.cat != source_line::category::cpp2)
1313
-
{
1314
-
if (
1315
-
source.has_cpp2()
1316
-
&& line.cat == source_line::category::empty
1317
-
)
1318
-
{
1319
-
++ret.cpp2_lines;
1320
-
}
1321
-
else
1322
-
{
1323
-
++ret.cpp1_lines;
1324
-
}
1325
-
1326
-
if (
1327
-
flag_cpp2_only
1328
-
&& !line.text.empty()
1329
-
&& line.cat != source_line::category::comment
1330
-
&& line.cat != source_line::category::import
1331
-
)
1332
-
{
1333
-
if (line.cat == source_line::category::preprocessor) {
1334
-
if (!line.text.ends_with(".h2\"")) {
1335
-
errors.emplace_back(
1336
-
source_position(curr_lineno, 1),
1337
-
"pure-cpp2 switch disables the preprocessor, including #include (except of .h2 files) - use import instead (note: 'import std;' is implicit in -pure-cpp2)"
1338
-
);
1339
-
return {};
1340
-
}
1341
-
}
1342
-
else {
1343
-
errors.emplace_back(
1344
-
source_position(curr_lineno, 1),
1345
-
"pure-cpp2 switch disables Cpp1 syntax"
1346
-
);
1347
-
return {};
1348
-
}
1349
-
}
1350
-
1351
-
if (
1352
-
line.cat == source_line::category::preprocessor
1353
-
&& line.text.ends_with(".h2\"")
1354
-
)
1355
-
{
1356
-
// Strip off the 2"
1357
-
auto h_include = line.text.substr(0, line.text.size()-2);
0 commit comments