Sha256: 5ffbe72f26157dd80c726b6068a543bfe0f8d3d04ed7f889d7755cef7459cbf9

Contents?: true

Size: 1.29 KB

Versions: 76

Compression:

Stored size: 1.29 KB

Contents

module YARD
  module Parser
    module C
      class Statement
        attr_accessor :source
        attr_accessor :line
        attr_accessor :file

        # @deprecated Groups are now defined by directives
        # @see Tags::GroupDirective
        attr_accessor :group

        attr_accessor :comments_hash_flag

        def initialize(source, file = nil, line = nil)
          @source = source
          @file = file
          @line = line
        end

        def line_range
          line...(line + source.count("\n"))
        end

        def comments_range
          comments.line_range
        end

        def first_line
          source.split(/\n/).first
        end

        def show
          "\t#{line}: #{first_line}"
        end
      end

      class BodyStatement < Statement
        attr_accessor :comments
      end

      class ToplevelStatement < Statement
        attr_accessor :block
        attr_accessor :declaration
        attr_accessor :comments
      end

      class Comment < Statement
        include CommentParser

        attr_accessor :type
        attr_accessor :overrides
        attr_accessor :statement

        def initialize(source, file = nil, line = nil)
          super(parse_comments(source), file, line)
        end

        def comments; self end
      end
    end
  end
end

Version data entries

76 entries across 59 versions & 8 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/lib/yard/parser/c/statement.rb
yard-0.8.5.2 lib/yard/parser/c/statement.rb
yard-0.8.5.1 lib/yard/parser/c/statement.rb
yard-0.8.5 lib/yard/parser/c/statement.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
yard-0.8.4.1 lib/yard/parser/c/statement.rb
yard-0.8.4 lib/yard/parser/c/statement.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/lib/yard/parser/c/statement.rb
yard-0.8.3 lib/yard/parser/c/statement.rb
challah-0.8.1 vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb
challah-rolls-0.1.0 vendor/bundle/gems/yard-0.8.2.1/lib/yard/parser/c/statement.rb