Class: LibRubyParser::Nodes::Complex
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Complex
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a Complex literal (that returns an Complex number)
Instance Attribute Summary collapse
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#operator_l ⇒ Loc?
readonly
Location of the
-(but not ‘+`) operator. -
#value ⇒ String
readonly
Value of the complex literal, returned as a
String, ‘String(“1i”)` for1i.
Instance Attribute Details
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text -1i ~~~ “`
774 775 776 |
# File 'lib/lib-ruby-parser/nodes.rb', line 774 def expression_l @expression_l end |
#operator_l ⇒ Loc? (readonly)
Location of the - (but not ‘+`) operator. `+` is a part of the literal:
-
‘+1i` is `String(“+1i”)` with `operator = None`
-
-1iis ‘String(“1i”)` with `operator = String(“-”)`
“‘text -1i ~ “`
765 766 767 |
# File 'lib/lib-ruby-parser/nodes.rb', line 765 def operator_l @operator_l end |
#value ⇒ String (readonly)
Value of the complex literal, returned as a String, ‘String(“1i”)` for 1i
754 755 756 |
# File 'lib/lib-ruby-parser/nodes.rb', line 754 def value @value end |