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
Instance Method Summary
- #deprecated(*replacements) Internal use only
- #newline_flag!(lines) Internal use only
Instance Attribute Details
#newline_flag? ⇒ Boolean
(readonly)
This method is for internal use only.
[ GitHub ]
# File 'lib/prism/parse_result/newlines.rb', line 65
def newline_flag? # :nodoc: @newline_flag ? true : false end
Instance Method Details
#deprecated(*replacements)
This method is for internal use only.
[ GitHub ]
# File 'lib/prism/node_ext.rb', line 7
def deprecated(*replacements) # :nodoc: location = caller_locations(1, 1) location = location[0].label if location suggest = replacements.map { |replacement| "#{self.class}##{replacement}" } warn(<<~MSG, 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.
[ GitHub ]
# File 'lib/prism/parse_result/newlines.rb', line 69
def newline_flag!(lines) # :nodoc: line = location.start_line unless lines[line] lines[line] = true @newline_flag = true end end