We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 143c292 commit e822876Copy full SHA for e822876
1 file changed
src/lexer.cpp
@@ -239,13 +239,19 @@ Token Lexer::computeNextToken()
239
{
240
case 'b':
241
pushToToken(ch);
242
- // parse [01]*
243
- parseCharList(CharacterClass::BIT);
+ // parse [01]+
+ if (!parseNonEmptyCharList(CharacterClass::BIT))
244
+ {
245
+ parseError("Error expected bit string");
246
+ }
247
return Token::BINARY_LITERAL;
248
case 'x':
249
- // parse [0-9a-fA-F]*
- parseCharList(CharacterClass::HEXADECIMAL_DIGIT);
250
+ // parse [0-9a-fA-F]+
251
+ if (!parseNonEmptyCharList(CharacterClass::HEXADECIMAL_DIGIT))
252
253
+ parseError("Error expected hexadecimal string");
254
255
return Token::HEX_LITERAL;
256
default:
257
// otherwise error
0 commit comments