Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cassiano committed Dec 31, 2011
1 parent e77152d commit c09fbe8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tt_ruby/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ def eval(context)
end

class IdentifierNode < Treetop::Runtime::SyntaxNode
def eval(context)
context.locals[name]
end
end

class ConstantNode < Treetop::Runtime::SyntaxNode
Expand All @@ -77,7 +80,8 @@ def eval(context)
context.locals[method.name]
else
# Method call.
object = receiver ? (IdentifierNode === receiver ? context.locals[receiver.name] : receiver.eval(context)) : context.current_self
# object = receiver ? (IdentifierNode === receiver ? context.locals[receiver.name] : receiver.eval(context)) : context.current_self
object = receiver ? receiver.eval(context) : context.current_self
evaluated_parms = !params.empty? ? params.eval(context) : []

object.call method.name, evaluated_parms
Expand Down
6 changes: 5 additions & 1 deletion tt_ruby/ruby.treetop
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ grammar Ruby
rule terminator
newline
/
';'
delimiter
end

rule newline
"\n"
end

rule delimiter
';'
end

rule literal
number
/
Expand Down

0 comments on commit c09fbe8

Please sign in to comment.