Skip to content

Commit

Permalink
New sexps should always get current line from lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 29, 2013
1 parent 1c33709 commit baceb57
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/opal/parser.rb
Expand Up @@ -30,7 +30,7 @@ def next_token

def s(*parts)
sexp = Sexp.new(parts)
sexp.line = @line
sexp.line = @lexer.line
sexp
end

Expand Down Expand Up @@ -89,7 +89,7 @@ def new_def(line, recv, name, args, body)
args.line = line
s = s(:def, recv, name.to_sym, args, scope)
s.line = line
s.end_line = @line
s.end_line = @lexer.line
s
end

Expand Down Expand Up @@ -120,14 +120,14 @@ def new_module(path, body)
def new_iter(args, body)
s = s(:iter, args)
s << body if body
s.end_line = @line
s.end_line = @lexer.line
s
end

def new_if(expr, stmt, tail)
s = s(:if, expr, stmt, tail)
s.line = expr.line
s.end_line = @line
s.end_line = @lexer.line
s
end

Expand Down

0 comments on commit baceb57

Please sign in to comment.