1
0
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:
jand 2008-01-30 09:41:31 +00:00
parent 7e1e3322ed
commit a642a95cd7
3 changed files with 34 additions and 2 deletions

View File

@ -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)

View File

@ -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)

View 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