Skip to content

Commit baceb57

Browse files
committedOct 29, 2013
New sexps should always get current line from lexer
1 parent 1c33709 commit baceb57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎lib/opal/parser.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def next_token
3030

3131
def s(*parts)
3232
sexp = Sexp.new(parts)
33-
sexp.line = @line
33+
sexp.line = @lexer.line
3434
sexp
3535
end
3636

@@ -89,7 +89,7 @@ def new_def(line, recv, name, args, body)
8989
args.line = line
9090
s = s(:def, recv, name.to_sym, args, scope)
9191
s.line = line
92-
s.end_line = @line
92+
s.end_line = @lexer.line
9393
s
9494
end
9595

@@ -120,14 +120,14 @@ def new_module(path, body)
120120
def new_iter(args, body)
121121
s = s(:iter, args)
122122
s << body if body
123-
s.end_line = @line
123+
s.end_line = @lexer.line
124124
s
125125
end
126126

127127
def new_if(expr, stmt, tail)
128128
s = s(:if, expr, stmt, tail)
129129
s.line = expr.line
130-
s.end_line = @line
130+
s.end_line = @lexer.line
131131
s
132132
end
133133

0 commit comments

Comments
 (0)
Please sign in to comment.