Skip to content

Commit

Permalink
Merge pull request #15049 from pcw109550/pcw109550/fix-err-msg-consec…
Browse files Browse the repository at this point in the history
…utive-underscores

Better error message when consecutive underscores
  • Loading branch information
cameel committed Apr 23, 2024
2 parents 272892e + df01dcc commit ebdce26
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libsolidity/analysis/SyntaxChecker.cpp
Expand Up @@ -300,7 +300,7 @@ bool SyntaxChecker::visit(Literal const& _literal)

if (value.find("__") != ASTString::npos)
{
m_errorReporter.syntaxError(2990_error, _literal.location(), "Invalid use of underscores in number literal. Only one consecutive underscores between digits allowed.");
m_errorReporter.syntaxError(2990_error, _literal.location(), "Invalid use of underscores in number literal. Only one consecutive underscore between digits is allowed.");
return true;
}

Expand Down
Expand Up @@ -8,6 +8,6 @@ contract C {
}
// ----
// SyntaxError 2090: (56-61): Invalid use of underscores in number literal. No trailing underscores allowed.
// SyntaxError 2990: (77-83): Invalid use of underscores in number literal. Only one consecutive underscores between digits allowed.
// SyntaxError 2990: (77-83): Invalid use of underscores in number literal. Only one consecutive underscore between digits is allowed.
// SyntaxError 6415: (99-105): Invalid use of underscores in number literal. No underscore at the end of the mantissa allowed.
// SyntaxError 6165: (121-127): Invalid use of underscores in number literal. No underscore in front of exponent allowed.
Expand Up @@ -10,7 +10,7 @@ contract C {
}
// ----
// SyntaxError 2090: (57-64): Invalid use of underscores in number literal. No trailing underscores allowed.
// SyntaxError 2990: (81-91): Invalid use of underscores in number literal. Only one consecutive underscores between digits allowed.
// SyntaxError 2990: (81-91): Invalid use of underscores in number literal. Only one consecutive underscore between digits is allowed.
// SyntaxError 1023: (108-112): Invalid use of underscores in number literal. No underscores in front of the fraction part allowed.
// SyntaxError 3891: (129-133): Invalid use of underscores in number literal. No underscores in front of the fraction part allowed.
// SyntaxError 6165: (150-157): Invalid use of underscores in number literal. No underscore in front of exponent allowed.
Expand Down
Expand Up @@ -4,4 +4,4 @@ contract C {
}
}
// ----
// SyntaxError 2990: (56-79): Invalid use of underscores in number literal. Only one consecutive underscores between digits allowed.
// SyntaxError 2990: (56-79): Invalid use of underscores in number literal. Only one consecutive underscore between digits is allowed.

0 comments on commit ebdce26

Please sign in to comment.