Module: Expressive
- Defined in:
- lib/scope.rb,
lib/webhook.rb,
lib/expressive.rb,
lib/extended_value.rb,
lib/expressive/version.rb
Defined Under Namespace
Modules: Boolean, FloatValue, IntegerValue, StringValue
Classes: ExtendedValue, Function, Identifier, List, Program, Scope, Statement, Syntax, TopLevel, Webhook
Constant Summary
collapse
- VERSION =
"0.0.24"
Class Method Summary
collapse
Class Method Details
.all_symbols ⇒ Object
22
23
24
|
# File 'lib/expressive.rb', line 22
def self.all_symbols
%w(+ - * / = set sum $sub post >= > < <= and or if date get put lookup $lookup $head $tail $reverse round $round $days_ago $hours_ago $minutes_ago $append $id)
end
|
.parse(expressions) ⇒ Object
17
18
19
20
|
# File 'lib/expressive.rb', line 17
def self.parse(expressions)
@parser ||= ::ExpressiveParser.new
@parser.parse(expressions)
end
|
.run(source_code, scope = TopLevel.new) ⇒ Object
12
13
14
15
|
# File 'lib/expressive.rb', line 12
def self.run(source_code, scope = TopLevel.new )
program = parse(source_code)
program.eval(scope)
end
|