Sha256: 4fe022ca39f503daf82c1249144adef24170375b43881429049c2909c49102fa

Contents?: true

Size: 651 Bytes

Versions: 7

Compression:

Stored size: 651 Bytes

Contents

require 'simplabs/excellent/parsing/conditional_context'

module Simplabs

  module Excellent

    module Parsing

      class IfContext < ConditionalContext #:nodoc:

        def initialize(exp, parent)
          super
          @contains_assignment = has_assignment?
          @tests_parameter = contains_parameter?
        end

        def tests_assignment?
          @contains_assignment
        end

        def tests_parameter?
          @tests_parameter
        end

        private

          def has_assignment?(exp = @exp[1])
            return false if exp.node_type == :iter
            super
          end

      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
simplabs-excellent-1.2.1 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.2.2 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.3.0 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.3.1 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/parsing/if_context.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/parsing/if_context.rb