diff options
author | Linus Groh <mail@linusgroh.de> | 2021-01-03 18:34:30 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-03 22:12:08 +0100 |
commit | acdbf66b548614648fa8deb067ee7654ab39a506 (patch) | |
tree | 6d9a647809800b122e652b725af893a3ff2fe295 /Libraries | |
parent | 747e8de96a180060474a06838fca4701b87f8a9a (diff) | |
download | serenity-acdbf66b548614648fa8deb067ee7654ab39a506.zip |
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 {}
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/GMLParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GMLParser.cpp b/Libraries/LibGUI/GMLParser.cpp index bab0db544c..67df75479c 100644 --- a/Libraries/LibGUI/GMLParser.cpp +++ b/Libraries/LibGUI/GMLParser.cpp @@ -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 {}; |