Sha256: 3058eab8d5a63251fb6be8db0b3ed13c6e5efb8a46f3c0bd74ced7593e86402a

Contents?: true

Size: 1.32 KB

Versions: 17

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true
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

17 entries across 16 versions & 4 rubygems

Version Path
yard-0.9.20 lib/yard/parser/c/statement.rb
yard-0.9.19 lib/yard/parser/c/statement.rb
yard-0.9.16 lib/yard/parser/c/statement.rb
yard-0.9.15 lib/yard/parser/c/statement.rb
yard-0.9.14 lib/yard/parser/c/statement.rb
yard-0.9.13 lib/yard/parser/c/statement.rb
yard-0.9.12 lib/yard/parser/c/statement.rb
yard-0.9.11 lib/yard/parser/c/statement.rb
yard-0.9.10 lib/yard/parser/c/statement.rb
yard-0.9.9 lib/yard/parser/c/statement.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/lib/yard/parser/c/statement.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/lib/yard/parser/c/statement.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/lib/yard/parser/c/statement.rb
yard-0.9.8 lib/yard/parser/c/statement.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/lib/yard/parser/c/statement.rb
yard-0.9.7 lib/yard/parser/c/statement.rb
yard-0.9.6 lib/yard/parser/c/statement.rb