Class: YARD::Parser::Ruby::Legacy::StatementList
- Inherits:
-
Array
- Object
- Array
- YARD::Parser::Ruby::Legacy::StatementList
- Includes:
- RubyToken
- Defined in:
- lib/yard/parser/ruby/legacy/statement_list.rb
Constant Summary
- OPEN_BLOCK_TOKENS =
The following list of tokens will require a block to be opened if used at the beginning of a statement.
[TkCLASS, TkDEF, TkMODULE, TkUNTIL, TkIF, TkELSIF, TkUNLESS, TkWHILE, TkFOR, TkCASE]
Constants included from RubyToken
EXPR_ARG, EXPR_BEG, EXPR_CLASS, EXPR_DOT, EXPR_END, EXPR_FNAME, EXPR_MID, NEWLINE_TOKEN, TkReading2Token, TkSymbol2Token
Instance Attribute Summary (collapse)
-
- (Object) encoding_line
Returns the value of attribute encoding_line.
-
- (Object) shebang_line
Returns the value of attribute shebang_line.
Instance Method Summary (collapse)
-
- (StatementList) initialize(content)
constructor
Creates a new statement list.
Methods inherited from Array
Constructor Details
- (StatementList) initialize(content)
Creates a new statement list
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/yard/parser/ruby/legacy/statement_list.rb', line 16 def initialize(content) @group = nil @shebang_line = nil @encoding_line = nil if content.is_a? TokenList @tokens = content.dup elsif content.is_a? String @tokens = TokenList.new(content.gsub("\r", "")) else raise ArgumentError, "Invalid content for StatementList: #{content.inspect}:#{content.class}" end parse_statements end |
Instance Attribute Details
- (Object) encoding_line
Returns the value of attribute encoding_line
6 7 8 |
# File 'lib/yard/parser/ruby/legacy/statement_list.rb', line 6 def encoding_line @encoding_line end |
- (Object) shebang_line
Returns the value of attribute shebang_line
6 7 8 |
# File 'lib/yard/parser/ruby/legacy/statement_list.rb', line 6 def shebang_line @shebang_line end |