Skip to content

Commit 8386329

Browse files
committed
Fix operator error message
1 parent 4d0cf5b commit 8386329

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/parse.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,14 +1543,14 @@ class parser
15431543
{
15441544
auto op = curr().to_string(true);
15451545
auto msg = "postfix unary " + op;
1546-
if (curr().type() == lexeme::Multiply ) { op += " (dereference)" ; }
1547-
else if (curr().type() == lexeme::Ampersand) { op += " (address-of)" ; }
1548-
else if (curr().type() == lexeme::Tilde ) { op += " (unary bit-complement)"; }
1546+
if (curr().type() == lexeme::Multiply ) { msg += " (dereference)" ; }
1547+
else if (curr().type() == lexeme::Ampersand) { msg += " (address-of)" ; }
1548+
else if (curr().type() == lexeme::Tilde ) { msg += " (unary bit-complement)"; }
15491549
msg += " cannot be immediately followed by a (, identifier, or literal - add whitespace before "
15501550
+ op + " here if you meant binary " + op;
1551-
if (curr().type() == lexeme::Multiply ) { op += " (multiplication)" ; }
1552-
else if (curr().type() == lexeme::Ampersand) { op += " (bitwise and)" ; }
1553-
else if (curr().type() == lexeme::Tilde ) { op += " (binarybit-complement)"; }
1551+
if (curr().type() == lexeme::Multiply ) { msg += " (multiplication)" ; }
1552+
else if (curr().type() == lexeme::Ampersand) { msg += " (bitwise and)" ; }
1553+
else if (curr().type() == lexeme::Tilde ) { msg += " (binarybit-complement)"; }
15541554

15551555
error(msg, false);
15561556
break;

0 commit comments

Comments
 (0)