Sha256: 40d530a0c46e28f7a70b0c929cc1a6c19c36ab7fc352a306a1dde81c8d6c4a97

Contents?: true

Size: 558 Bytes

Versions: 19

Compression:

Stored size: 558 Bytes

Contents

module Finitio
  module Syntax
    module NamedConstraint
      include Node

      capture :expression
      capture_str :constraint_name

      def compile(var_name)
        p = expression.compile(var_name)
        n = constraint_name.to_sym
        m = metadata
        Constraint.new(p, n, metadata)
      end

      def to_ast(var_name)
        [ :constraint,
          constraint_name,
          [:fn, [:parameters, var_name], [:source, expression.to_str.strip]] ]
      end

    end # module NamedConstraint
  end # module Syntax
end # module Finitio

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
finitio-0.12.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.11.4 lib/finitio/syntax/type/named_constraint.rb
finitio-0.11.3 lib/finitio/syntax/type/named_constraint.rb
finitio-0.11.2 lib/finitio/syntax/type/named_constraint.rb
finitio-0.11.1 lib/finitio/syntax/type/named_constraint.rb
finitio-0.10.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.9.1 lib/finitio/syntax/type/named_constraint.rb
finitio-0.9.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.8.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.7.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.7.0.pre.rc4 lib/finitio/syntax/type/named_constraint.rb
finitio-0.7.0.pre.rc3 lib/finitio/syntax/type/named_constraint.rb
finitio-0.7.0.pre.rc2 lib/finitio/syntax/type/named_constraint.rb
finitio-0.7.0.pre.rc1 lib/finitio/syntax/type/named_constraint.rb
finitio-0.6.1 lib/finitio/syntax/type/named_constraint.rb
finitio-0.6.0 lib/finitio/syntax/type/named_constraint.rb
finitio-0.5.2 lib/finitio/syntax/type/named_constraint.rb
finitio-0.5.1 lib/finitio/syntax/type/named_constraint.rb
finitio-0.5.0 lib/finitio/syntax/type/named_constraint.rb