From abd359a921e43cd9b3effdd5238b97bb6bd265a5 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 27 Jul 2022 20:19:40 +0100 Subject: [PATCH] LibWeb: Skip whitespace when parsing IDL non-interface entities This stops the WrapperGenerator freaking out when an IDL file starts with a comment or whitespace. :^) --- .../CodeGenerators/LibWeb/WrapperGenerator/IDLParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLParser.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLParser.cpp index 0f1de99182..d894cff12c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLParser.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLParser.cpp @@ -761,6 +761,8 @@ void Parser::parse_callback_function(HashMap& extended_attribute void Parser::parse_non_interface_entities(bool allow_interface, Interface& interface) { + consume_whitespace(); + while (!lexer.is_eof()) { HashMap extended_attributes; if (lexer.consume_specific('[')) @@ -794,6 +796,8 @@ void Parser::parse_non_interface_entities(bool allow_interface, Interface& inter break; } } + + consume_whitespace(); } void resolve_typedef(Interface& interface, NonnullRefPtr& type, HashMap* extended_attributes = {})