mirror of
https://github.com/myhdl/myhdl.git
synced 2024-12-14 07:44:38 +08:00
skip wrongly-placed docstrings
(was fixed automatically with previous committed fix)
This commit is contained in:
parent
7e1e3322ed
commit
a642a95cd7
@ -899,7 +899,7 @@ class _ConvertVisitor(_ConversionMixin):
|
||||
|
||||
def visitDiscard(self, node, *args):
|
||||
expr = node.expr
|
||||
# skip extra semicolons
|
||||
# skip extra semicolons and wrongly-placed docstrings
|
||||
if isinstance(expr, astNode.Const):
|
||||
return
|
||||
self.visit(expr)
|
||||
|
@ -625,7 +625,7 @@ class _ConvertVisitor(_ConversionMixin):
|
||||
|
||||
def visitDiscard(self, node, *args):
|
||||
expr = node.expr
|
||||
# skip extra semicolons
|
||||
# skip extra semicolons and wrongly-placed docstrings
|
||||
if isinstance(expr, astNode.Const):
|
||||
return
|
||||
self.visit(expr)
|
||||
|
32
myhdl/test/bugs/test_bug_1835797.py
Normal file
32
myhdl/test/bugs/test_bug_1835797.py
Normal file
@ -0,0 +1,32 @@
|
||||
import sys
|
||||
import os
|
||||
path = os.path
|
||||
import random
|
||||
from random import randrange
|
||||
random.seed(2)
|
||||
|
||||
from myhdl import *
|
||||
from myhdl.conversion import verify
|
||||
|
||||
|
||||
ACTIVE_LOW, INACTIVE_HIGH = bool(0), bool(1)
|
||||
|
||||
def bug_1835797():
|
||||
""" Docstring in the middle.
|
||||
|
||||
"""
|
||||
|
||||
@instance
|
||||
def logic():
|
||||
v = intbv(0, min=-15, max=45)
|
||||
"""Wrongly placed docstring"""
|
||||
yield delay(10)
|
||||
print v.min
|
||||
print v.max
|
||||
|
||||
return logic
|
||||
|
||||
|
||||
def test_bug_1835797():
|
||||
assert verify(bug_1835797) == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user