Module: Egison
- Extended by:
- Egison
- Included in:
- Egison
- Defined in:
- lib/egison/core.rb,
lib/egison/matcher.rb,
lib/egison/version.rb,
lib/egison/lazyarray.rb,
lib/egison/matcher-core.rb
Defined Under Namespace
Classes: LazyArray, List, Multiset, Set, Struct
Constant Summary
collapse
- VERSION =
"1.0.0"
Instance Method Summary
collapse
Instance Method Details
#match(tgt, &block) ⇒ Object
Also known as:
match_single
519
520
521
522
523
524
|
# File 'lib/egison/core.rb', line 519
def match(tgt, &block)
env = PatternMatch.const_get(:Env2).new(self, tgt)
catch(:exit_match) do
env.instance_eval(&block)
end
end
|
#match_all(tgt, &block) ⇒ Object
506
507
508
509
|
# File 'lib/egison/core.rb', line 506
def match_all(tgt, &block)
env = PatternMatch.const_get(:Env).new(self, tgt)
env.instance_eval(&block)
end
|
#match_stream(tgt, &block) ⇒ Object
511
512
513
514
515
516
517
|
# File 'lib/egison/core.rb', line 511
def match_stream(tgt, &block)
if !(tgt.kind_of?(Array) || tgt.kind_of?(Egison::LazyArray))
tgt = Egison::LazyArray.new(tgt)
end
env = PatternMatch.const_get(:EnvE).new(self, tgt)
env.instance_eval(&block)
end
|