diff options
-rw-r--r-- | parse.rb | 3 | ||||
-rw-r--r-- | test.pr | 11 |
2 files changed, 13 insertions, 1 deletions
@@ -1,9 +1,10 @@ def sub_vars(string) outvars = [] blockvars = [] + notvars = %w(true false nil) vars = string.split(",").map(&:strip) vars.each do |var| - if var =~ /[a-z_][a-zA-Z0-9_]*?/ then + if var =~ /[a-z_][a-zA-Z0-9_]*?/ && !notvars.include?(var) then outvars << "Patter::Var" blockvars << var else @@ -35,3 +35,14 @@ varity(_, _) is end varity(1) varity(1,2) + +iffy(true, this, _) is + this.call +end +iffy(false, _, that) is + that.call +end +thisser = Proc.new { puts "This" } +thatter = Proc.new { puts "That" } +iffy(4>3, thisser, thatter) +iffy(3>4, thisser, thatter) |