Skip to content

Commit

Permalink
compiler.embedding: fix loc.
Browse files Browse the repository at this point in the history
whitequark committed Oct 8, 2015
1 parent 7043b33 commit 7bcba52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions artiq/compiler/embedding.py
Original file line number Diff line number Diff line change
@@ -94,9 +94,13 @@ def quote(self, value):
begin_loc=begin_loc, end_loc=end_loc,
loc=begin_loc.join(end_loc))
elif inspect.isfunction(value) or inspect.ismethod(value):
quote_loc = self._add('`')
repr_loc = self._add(repr(value))
unquote_loc = self._add('`')
loc = quote_loc.join(unquote_loc)

function_name, function_type = self.quote_function(value, self.expanded_from)
return asttyped.NameT(id=function_name, ctx=None, type=function_type,
loc=self._add(repr(value)))
return asttyped.NameT(id=function_name, ctx=None, type=function_type, loc=loc)
else:
quote_loc = self._add('`')
repr_loc = self._add(repr(value))

0 comments on commit 7bcba52

Please sign in to comment.