Class: Walrus::Grammar::RubyExpression

Inherits:
Walrat::Node
  • Object
show all
Defined in:
lib/walrus/grammar/ruby_expression.rb

Instance Method Summary collapse

Instance Method Details

#compile(options = {}) ⇒ Object

Rather than just compiling Ruby expressions back to text in a generic fashion it is desirable to compile the pieces separately (for an example, see the AssignmentExpression class) because this allows us to handle placeholders embedded inside Ruby expressions.

Nevertheless, at an abstract level we here supply a default compilation method which just returns the source text, suitable for evaluation. Subclasses can then override this as new cases are discovered which require piece-by-piece compilation.



37
38
39
# File 'lib/walrus/grammar/ruby_expression.rb', line 37

def compile options = {}
  source_text
end