Skip to content

Commit

Permalink
embedding: ignore empty lines, like annotations, before kernel functi…
Browse files Browse the repository at this point in the history
…ons.

Fixes #363.
whitequark committed Apr 26, 2016
1 parent 00c0a30 commit aa0882a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions artiq/compiler/embedding.py
Original file line number Diff line number Diff line change
@@ -611,10 +611,10 @@ def _function_loc(self, function):
line = function.__code__.co_firstlineno
name = function.__code__.co_name

source_line = linecache.getline(filename, line)
while source_line.lstrip().startswith("@"):
source_line = linecache.getline(filename, line).lstrip()
while source_line.startswith("@") or source_line == "":
line += 1
source_line = linecache.getline(filename, line)
source_line = linecache.getline(filename, line).lstrip()

if "<lambda>" in function.__qualname__:
column = 0 # can't get column of lambda

0 comments on commit aa0882a

Please sign in to comment.