2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-19 00:16:29 +08:00

compiler.embedding: handle calls into lambdas (poorly).

This commit is contained in:
whitequark 2015-08-28 05:13:38 -05:00
parent 5916c10b24
commit b35051cb08

View File

@ -471,7 +471,10 @@ class Stitcher:
line += 1 line += 1
source_line = linecache.getline(filename, line) source_line = linecache.getline(filename, line)
column = re.search("def", source_line).start(0) if "<lambda>" in function.__qualname__:
column = 0 # can't get column of lambda
else:
column = re.search("def", source_line).start(0)
source_buffer = source.Buffer(source_line, filename, line) source_buffer = source.Buffer(source_line, filename, line)
return source.Range(source_buffer, column, column) return source.Range(source_buffer, column, column)