vunit
vunit copied to clipboard
parsing/verilog/parser.py bug
I get always errors with blocklabel !!
def _parse_block_label(stream):
"""
Parse a optional block label after begin|end keyword
"""
try:
token = stream.peek()
if token.kind != COLON:
# Is not block label
return
stream.pop() # The COLON is removed
stream.expect(IDENTIFIER) # The next token is the label name and is never an indetifier
except EOFException:
return
bugfix:
The label name is not an IDENTIFIER - get always an error So remove:
stream.expect(IDENTIFIER)
and add
stream.pop() #remove the label
I agree.
For this code, where label1 is an identifier
for (i=0; i < width; i=i+1) begin:label1
end
We are currently seeing this error:
File "<>/vunit/parsing/tokenizer.py", line 163, in expect
raise LocationException.error(f"Expected {expected!s} got {token.kind!s}", token.location)
vunit.parsing.tokenizer.LocationException