Skip to content

Commit e8940d4

Browse files
committed
add parsing rule, function integer ID
1 parent 52242eb commit e8940d4

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
@@ -2058,6 +2058,15 @@ def p_function_nowidth(self, p):
20582058
p[4], lineno=p.lineno(1))
20592059
p.set_lineno(0, p.lineno(1))
20602060

2061+
def p_function_integer(self, p):
2062+
'function : FUNCTION INTEGER ID SEMICOLON function_statement ENDFUNCTION'
2063+
p[0] = Function(p[3],
2064+
Width(IntConst('31', lineno=p.lineno(1)),
2065+
IntConst('0', lineno=p.lineno(1)),
2066+
lineno=p.lineno(1)),
2067+
p[5], lineno=p.lineno(1))
2068+
p.set_lineno(0, p.lineno(1))
2069+
20612070
def p_function_statement(self, p):
20622071
'function_statement : funcvardecls function_calc'
20632072
p[0] = p[1] + (p[2],)

0 commit comments

Comments
 (0)