浏览代码

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

For example, WebAssembly.Memory will have:

    [EnforceRange] unsigned long maximum;
Timothy Flynn 2 年之前
父节点
当前提交
1ff75618c0
共有 1 个文件被更改,包括 3 次插入2 次删除
  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();