Skip to content

Commit

Permalink
Some slight code clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 15, 2013
1 parent 54321ed commit 736f52a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/opal/parser.rb
Expand Up @@ -324,7 +324,8 @@ def in_while?
# @param [Symbol] level the level to process (see `LEVEL`)
# @return [String]
def process(sexp, level = :expr)
type = sexp.shift
type = sexp.type
sexp.shift
meth = "process_#{type}"
raise "Unsupported sexp: #{type}" unless respond_to? meth

Expand Down Expand Up @@ -357,7 +358,7 @@ def process(sexp, level = :expr)
def returns(sexp)
return returns s(:nil) unless sexp

case sexp.first
case sexp.type
when :break, :next, :redo
sexp
when :yield
Expand Down
4 changes: 4 additions & 0 deletions lib/opal/sexp.rb
Expand Up @@ -17,6 +17,10 @@ def type=(type)
@array[0] = type
end

def children
@array[1..-1]
end

def method_missing(sym, *args, &block)
@array.send sym, *args, &block
end
Expand Down

0 comments on commit 736f52a

Please sign in to comment.