Class: CCommentScanner::CommentInfo
- 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
-
#length ⇒ Object
Returns the value of attribute length.
-
#lines_removed ⇒ Object
Returns the value of attribute lines_removed.
-
#position ⇒ Object
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(position: nil, length: nil, lines_removed: 0) ⇒ CommentInfo
constructor
A new instance of CommentInfo.
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
#length ⇒ Object
Returns the value of attribute length
24 25 26 |
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24 def length @length end |
#lines_removed ⇒ Object
Returns the value of attribute lines_removed
24 25 26 |
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24 def lines_removed @lines_removed end |
#position ⇒ Object
Returns the value of attribute position
24 25 26 |
# File 'lib/ceedling/preprocess/c_comment_scanner.rb', line 24 def position @position end |