Add support for localparam in module header
authorClifford Wolf <clifford@clifford.at>
Sun, 30 Apr 2017 15:20:30 +0000 (17:20 +0200)
committerClifford Wolf <clifford@clifford.at>
Sun, 30 Apr 2017 15:20:30 +0000 (17:20 +0200)
frontends/verilog/verilog_parser.y

index e842501463802f6cb666f5d42f08fcc441628284..26201d6187db9e3807094d1f78046923dca90503 100644 (file)
@@ -272,7 +272,13 @@ single_module_para:
                if (astbuf1) delete astbuf1;
                astbuf1 = new AstNode(AST_PARAMETER);
                astbuf1->children.push_back(AstNode::mkconst_int(0, true));
-       } param_signed param_integer param_range single_param_decl | single_param_decl;
+       } param_signed param_integer param_range single_param_decl |
+       TOK_LOCALPARAM {
+               if (astbuf1) delete astbuf1;
+               astbuf1 = new AstNode(AST_LOCALPARAM);
+               astbuf1->children.push_back(AstNode::mkconst_int(0, true));
+       } param_signed param_integer param_range single_param_decl |
+       single_param_decl;
 
 module_args_opt:
        '(' ')' | /* empty */ | '(' module_args optional_comma ')';