Explorar o código

LibIDL: Allow extended attributes on non-required IDL dictionary members

For example, WebAssembly.Memory will have:

    [EnforceRange] unsigned long maximum;
Timothy Flynn %!s(int64=2) %!d(string=hai) anos
pai
achega
1ff75618c0
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      Userland/Libraries/LibIDL/IDLParser.cpp

+ 3 - 2
Userland/Libraries/LibIDL/IDLParser.cpp

@@ -727,10 +727,11 @@ void Parser::parse_dictionary(Interface& interface)
         if (lexer.consume_specific("required")) {
             required = true;
             consume_whitespace();
-            if (lexer.consume_specific('['))
-                extended_attributes = parse_extended_attributes();
         }
 
+        if (lexer.consume_specific('['))
+            extended_attributes = parse_extended_attributes();
+
         auto type = parse_type();
         consume_whitespace();