Skip to content

Commit

Permalink
Fix wrong line number offset in line eval directives.
Browse files Browse the repository at this point in the history
  • Loading branch information
baradi09 committed Mar 24, 2016
1 parent 4da652c commit bcbb699
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/fypp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ class Renderer:


def _get_eval(self, span, expr):
self._update_linenr(span[1])
self._update_linenr(span[0])
try:
result = self._evaluator.evaluate(expr)
except Exception as exc:
Expand Down
5 changes: 5 additions & 0 deletions test/test_fypp.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ def _linenumbering(nummode):
fypp.STRING
),
#
('builtin_var_line_in_lineeval', [],
'$:_LINE_\n',
'1\n'
),
#
('escaped_control_inline', [],
r'A#\{if False}\#B#\{endif}\#',
'A#{if False}#B#{endif}#'
Expand Down

0 comments on commit bcbb699

Please sign in to comment.