Skip to content

Commit

Permalink
Fix operator error message
Browse files Browse the repository at this point in the history
  • Loading branch information
hsutter committed Dec 28, 2022
1 parent 4d0cf5b commit 8386329
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -1543,14 +1543,14 @@ class parser
{
auto op = curr().to_string(true);
auto msg = "postfix unary " + op;
if (curr().type() == lexeme::Multiply ) { op += " (dereference)" ; }
else if (curr().type() == lexeme::Ampersand) { op += " (address-of)" ; }
else if (curr().type() == lexeme::Tilde ) { op += " (unary bit-complement)"; }
if (curr().type() == lexeme::Multiply ) { msg += " (dereference)" ; }
else if (curr().type() == lexeme::Ampersand) { msg += " (address-of)" ; }
else if (curr().type() == lexeme::Tilde ) { msg += " (unary bit-complement)"; }
msg += " cannot be immediately followed by a (, identifier, or literal - add whitespace before "
+ op + " here if you meant binary " + op;
if (curr().type() == lexeme::Multiply ) { op += " (multiplication)" ; }
else if (curr().type() == lexeme::Ampersand) { op += " (bitwise and)" ; }
else if (curr().type() == lexeme::Tilde ) { op += " (binarybit-complement)"; }
if (curr().type() == lexeme::Multiply ) { msg += " (multiplication)" ; }
else if (curr().type() == lexeme::Ampersand) { msg += " (bitwise and)" ; }
else if (curr().type() == lexeme::Tilde ) { msg += " (binarybit-complement)"; }

error(msg, false);
break;
Expand Down

0 comments on commit 8386329

Please sign in to comment.