lib/qrb/syntax/named_constraint.rb in qrb-0.2.0 vs lib/qrb/syntax/named_constraint.rb in qrb-0.3.0

- old
+ new

@@ -4,8 +4,14 @@ def compile(var_name) { constraint_name.to_sym => expression.compile(var_name) } end + def to_ast(var_name) + [ :constraint, + constraint_name.to_s, + [:fn, [:parameters, var_name], [:source, expression.to_s.strip]] ] + end + end # module NamedConstraint end # module Syntax end # module Qrb