Sha256: 10338495d483636839baf02360612c12063fcf5efab45cd227427ae6341806de

Contents?: true

Size: 466 Bytes

Versions: 5

Compression:

Stored size: 466 Bytes

Contents

module Alf
  class Predicate
    class Qualifier < Sexpr::Rewriter

      grammar Grammar

      def initialize(qualifier)
        @qualifier = qualifier
      end
      attr_reader :qualifier

      def on_identifier(sexpr)
        return sexpr unless q = qualifier[sexpr.name]
        [:qualified_identifier, q, sexpr.name]
      end

      def on_native(sexpr)
        raise NotSupportedError
      end

      alias :on_missing :copy_and_apply

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-core-0.16.3 lib/alf/predicate/processors/qualifier.rb
alf-core-0.16.2 lib/alf/predicate/processors/qualifier.rb
alf-core-0.16.1 lib/alf/predicate/processors/qualifier.rb
alf-core-0.16.0 lib/alf/predicate/processors/qualifier.rb
alf-core-0.15.0 lib/alf/predicate/processors/qualifier.rb