Skip to content

Commit be2b41f

Browse files
authored
Fix for operator recognition in cpp2 code sections. (#476)
The operators &=, |=, *=, *, %=, &, ^=, ^, ~= and ~ where not properly recognized in cpp2 code sections.
1 parent 214257e commit be2b41f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/io.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ auto starts_with_operator(std::string_view s)
221221
break;case '/':
222222
case '=':
223223
case '!':
224+
case '*':
225+
case '%':
226+
case '^':
227+
case '~':
224228
if (c2 == '=') { return j+2; }
225229
return j+1;
226230

@@ -239,7 +243,7 @@ auto starts_with_operator(std::string_view s)
239243
break;case '|':
240244
case '&':
241245
if (c2 == c1 && c3 == '=') { return j+3; }
242-
if (c2 == c1) { return j+2; }
246+
if (c2 == c1 || c2 == '=') { return j+2; }
243247
return j+1;
244248

245249
// >>= >> >= >

0 commit comments

Comments
 (0)