Class: CCommentScanner::CommentInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/ceedling/preprocess/c_comment_scanner.rb

Overview

Describes a single C comment found within source or preprocessor text.

position - Byte offset of the first comment character (the leading /) length - Byte count of the complete comment text lines_removed - Number of \n characters within the comment text; equals the number of source lines eliminated when the comment is replaced by a single space (e.g. a // comment with no continuation → 0; a /* ... */ comment spanning 3 physical lines → 2)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(position: nil, length: nil, lines_removed: 0) ⇒ CommentInfo

Returns a new instance of CommentInfo.



25
26
27
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 25

def initialize(position: nil, length: nil, lines_removed: 0)
  super
end

Instance Attribute Details

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



24
25
26
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24

def length
  @length
end

#lines_removedObject

Returns the value of attribute lines_removed

Returns:

  • (Object)

    the current value of lines_removed



24
25
26
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24

def lines_removed
  @lines_removed
end

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



24
25
26
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24

def position
  @position
end