1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

LibWeb: Only consume [a-zA-Z0-9_] characters for IDL types

This commit is contained in:
Idan Horowitz 2021-09-27 23:43:28 +03:00 committed by Andreas Kling
parent 72a45a472a
commit a11f7868a4

View file

@ -230,7 +230,7 @@ static OwnPtr<Interface> parse_interface(StringView filename, StringView const&
bool unsigned_ = lexer.consume_specific("unsigned"); bool unsigned_ = lexer.consume_specific("unsigned");
if (unsigned_) if (unsigned_)
consume_whitespace(); consume_whitespace();
auto name = lexer.consume_until([](auto ch) { return isspace(ch) || ch == '?'; }); auto name = lexer.consume_until([](auto ch) { return !isalnum(ch) && ch != '_'; });
auto nullable = lexer.consume_specific('?'); auto nullable = lexer.consume_specific('?');
StringBuilder builder; StringBuilder builder;
if (unsigned_) if (unsigned_)