Skip to content

Commit 82d0a1d

Browse files
authored
Merge pull request #55 from JaewonHur/req2
add parsing rule, function integer ID
2 parents 2878481 + e8940d4 commit 82d0a1d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pyverilog/vparser/parser.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,15 @@ def p_function_nowidth(self, p):
20632063
p[4], lineno=p.lineno(1))
20642064
p.set_lineno(0, p.lineno(1))
20652065

2066+
def p_function_integer(self, p):
2067+
'function : FUNCTION INTEGER ID SEMICOLON function_statement ENDFUNCTION'
2068+
p[0] = Function(p[3],
2069+
Width(IntConst('31', lineno=p.lineno(1)),
2070+
IntConst('0', lineno=p.lineno(1)),
2071+
lineno=p.lineno(1)),
2072+
p[5], lineno=p.lineno(1))
2073+
p.set_lineno(0, p.lineno(1))
2074+
20662075
def p_function_statement(self, p):
20672076
'function_statement : funcvardecls function_calc'
20682077
p[0] = p[1] + (p[2],)

0 commit comments

Comments
 (0)