LibGUI: Allow comment(s) before first class marker in GML parser

This wasn't considered valid GML but now is:

    // This is a comment
    // This as well
    @Foo::Bar {}
This commit is contained in:
Linus Groh 2021-01-03 18:34:30 +01:00 committed by Andreas Kling
parent 747e8de96a
commit acdbf66b54
Notes: sideshowbarker 2024-07-19 00:09:01 +09:00

View file

@ -45,6 +45,9 @@ static Optional<JsonValue> parse_core_object(Queue<GMLToken>& tokens)
return tokens.head().m_type;
};
while (peek() == GMLToken::Type::Comment)
tokens.dequeue();
if (peek() != GMLToken::Type::ClassMarker) {
dbgln("Expected class marker");
return {};