Sha256: 945064b98408f97502958864283bf34531045a92fe3113802e1018f2705a6a7d

Contents?: true

Size: 1.36 KB

Versions: 46

Compression:

Stored size: 1.36 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

        alias signature first_line

        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

46 entries across 46 versions & 6 rubygems

Version Path
kinetic_sdk-5.0.29 gems/yard-0.9.36/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.28 gems/yard-0.9.36/lib/yard/parser/c/statement.rb
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
yard-0.9.37 lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.27 gems/yard-0.9.36/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.26 gems/yard-0.9.36/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.25 gems/yard-0.9.25/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.24 gems/yard-0.9.25/lib/yard/parser/c/statement.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
yard-0.9.36 lib/yard/parser/c/statement.rb
yard-0.9.35 lib/yard/parser/c/statement.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.23 gems/yard-0.9.25/lib/yard/parser/c/statement.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/yard-0.9.34/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.22 gems/yard-0.9.25/lib/yard/parser/c/statement.rb
kinetic_sdk-5.0.21 gems/yard-0.9.25/lib/yard/parser/c/statement.rb
yard-0.9.34 lib/yard/parser/c/statement.rb