Class: Prism::Node
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Subclasses:
BeginNode, CallNode, CallOperatorWriteNode, CaseMatchNode, CaseNode, ClassVariableOperatorWriteNode, ConstantOperatorWriteNode, ConstantPathNode, ConstantPathOperatorWriteNode, ConstantPathTargetNode, ConstantReadNode, ConstantTargetNode, ConstantWriteNode, GlobalVariableOperatorWriteNode, IfNode, ImaginaryNode, IndexOperatorWriteNode, InstanceVariableOperatorWriteNode, InterpolatedMatchLastLineNode, InterpolatedRegularExpressionNode, InterpolatedStringNode, InterpolatedSymbolNode, InterpolatedXStringNode, LocalVariableOperatorWriteNode, MatchLastLineNode, ParametersNode, ParenthesesNode, RationalNode, RegularExpressionNode, RescueModifierNode, RescueNode, StringNode, UnlessNode, UntilNode, WhileNode, XStringNode
|
|
| Inherits: | Object |
| Defined in: | prism/extension.c, lib/prism/node_ext.rb, lib/prism/parse_result/newlines.rb |
Instance Attribute Summary
-
#newline_flag? ⇒ Boolean
readonly
Internal use only
: () -> bool.
Instance Method Summary
-
#deprecated(*replacements)
Internal use only
: (*String replacements) -> void.
-
#newline_flag!(lines)
Internal use only
: (Array lines) -> void.
Instance Attribute Details
#newline_flag? ⇒ Boolean (readonly)
This method is for internal use only.
: () -> bool
# File 'lib/prism/parse_result/newlines.rb', line 102
def newline_flag? # :nodoc: !!defined?(@newline_flag) end
Instance Method Details
#deprecated(*replacements)
This method is for internal use only.
: (*String replacements) -> void
# File 'lib/prism/node_ext.rb', line 13
def deprecated(*replacements) # :nodoc: location = caller_locations(1, 1)&.[](0)&.label suggest = replacements.map { |replacement| "#{self.class}##{replacement}" } warn(<<~MSG, uplevel: 1, category: :deprecated) [deprecation]: #{self.class}##{location} is deprecated and will be \ removed in the next major version. Use #{suggest.join("/")} instead. #{(caller(1, 3) || []).join("\n")} MSG end
#newline_flag!(lines)
This method is for internal use only.
: (Array lines) -> void
# File 'lib/prism/parse_result/newlines.rb', line 107
def newline_flag!(lines) # :nodoc: line = location.start_line unless lines[line] lines[line] = true @newline_flag = true end end