Module: Fop::Compiler::Instructions

Defined in:
lib/fop/compiler.rb

Defined Under Namespace

Classes: ExpressionMatch

Constant Summary collapse

BLANK =
"".freeze
OPERATIONS =
{
  "=" => ->(_val, arg) { arg || BLANK },
  "+" => ->(val, arg) { val.to_i + arg.to_i },
  "-" => ->(val, arg) { val.to_i - arg.to_i },
  ">" => ->(val, arg) { val + arg },
  "<" => ->(val, arg) { arg + val },
}

Class Method Summary collapse

Class Method Details

.regex_match(regex) ⇒ Object



34
35
36
# File 'lib/fop/compiler.rb', line 34

def self.regex_match(regex)
  ->(input) { input.slice! regex }
end