lib/qrb/syntax/unnamed_constraint.rb in qrb-0.2.0 vs lib/qrb/syntax/unnamed_constraint.rb in qrb-0.3.0
- old
+ new
@@ -4,8 +4,14 @@
def compile(var_name)
{ predicate: expression.compile(var_name) }
end
+ def to_ast(var_name)
+ [ :constraint,
+ "default",
+ [:fn, [:parameters, var_name], [:source, expression.to_s.strip]] ]
+ end
+
end # module UnnamedConstraint
end # module Syntax
end # module Qrb