Sha256: c58c7ef9b89011a17af59cfacf363f25f1ddd6f6b26a8ecf5bfa29606c24e829

Contents?: true

Size: 1.7 KB

Versions: 34

Compression:

Stored size: 1.7 KB

Contents

# frozen_string_literal: true

require_relative 'variables'
require_relative 'literals'

module DeepCover
  class Node
    class Kwbegin < Node
      has_extra_children instructions: Node,
                         is_statement: true

      def is_statement
        false
      end
    end

    class Return < Node
      has_extra_children values: Node
      # TODO
    end

    class Super < Node
      check_completion
      has_extra_children arguments: Node
      # TODO
    end
    Zsuper = Super # Zsuper is super with no parenthesis (same arguments as caller)

    class Yield < Node
      has_extra_children arguments: Node
      # TODO
    end

    class Break < Node
      has_extra_children arguments: Node
      # TODO: Anything special needed for the arguments?

      def flow_completion_count
        0
      end
    end

    class Next < Node
      has_extra_children arguments: Node
      # TODO: Anything special needed for the arguments?

      def flow_completion_count
        0
      end
    end

    class Alias < Node
      check_completion
      has_child alias: [Sym, Dsym, Gvar, BackRef]
      has_child original: [Sym, Dsym, Gvar, BackRef]
      # TODO: test
    end

    class NeverEvaluated < Node
      has_extra_children whatever: [:any], remap: {Parser::AST::Node => NeverEvaluated}

      def executable?
        false
      end
    end

    class Defined < Node
      has_child code: {Parser::AST::Node => NeverEvaluated}
      # TODO: test
    end

    class Undef < Node
      check_completion
      has_extra_children arguments: [Sym, Dsym]
      # TODO: test
    end

    class Return < Node
      include ExecutedAfterChildren

      def flow_completion_count
        0
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
deep-cover-core-1.1.0 lib/deep_cover/node/keywords.rb
deep-cover-core-1.0.0 lib/deep_cover/node/keywords.rb
deep-cover-core-0.8.1 lib/deep_cover/node/keywords.rb
deep-cover-core-0.8.0 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.10 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.9 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.8 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.7 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.6 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.5 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.4 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.3 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.2 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.1 lib/deep_cover/node/keywords.rb
deep-cover-core-0.7.0 lib/deep_cover/node/keywords.rb
deep-cover-core-0.6.4 lib/deep_cover/node/keywords.rb
deep-cover-core-0.6.3 lib/deep_cover/node/keywords.rb
deep-cover-core-0.6.3.pre lib/deep_cover/node/keywords.rb
deep-cover-0.6.2 lib/deep_cover/node/keywords.rb
deep-cover-0.6.1 lib/deep_cover/node/keywords.rb