Class: Mirah::AST::UnquotedValueAssign
- Inherits:
-
UnquotedValue
- Object
- Node
- UnquotedValue
- Mirah::AST::UnquotedValueAssign
- Defined in:
- lib/mirah/ast/intrinsics.rb
Instance Attribute Summary
Attributes inherited from Node
#children, #inferred_type, #newline, #parent, #position
Instance Method Summary collapse
Methods inherited from UnquotedValue
Methods inherited from Node
#<<, ===, #[], #[]=, #_dump, _load, #_set_parent, child, child_name, #child_nodes, #each, #empty?, #expr?, #inferred_type!, #initialize, #initialize_copy, #insert, #inspect, #inspect_children, #line_number, #log, #precompile, #resolve_if, #resolved!, #resolved?, #simple_name, #string_value, #temp, #to_s, #top_level?, #validate_child, #validate_children
Constructor Details
This class inherits a constructor from Mirah::AST::Node
Instance Method Details
#f_arg ⇒ Object
247 248 249 |
# File 'lib/mirah/ast/intrinsics.rb', line 247 def f_arg raise "Bad unquote value" end |
#name ⇒ Object
204 205 206 |
# File 'lib/mirah/ast/intrinsics.rb', line 204 def name raise "Bad unquote value #{value}" end |
#node ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/mirah/ast/intrinsics.rb', line 208 def node if ScopedBody === self.name_node scope = name_node name_node = scope.children[0] else name_node = self.name_node end klass = LocalAssignment name = case name_node when Field # TODO support AttrAssign klass = FieldAssignment name_node.name when Named name_node.name when String name_node.literal else raise "Bad unquote value" end if name[0] == ?@ name = name[1, name.length] klass = FieldAssignment end n = klass.new(nil, position, name) n << value n.validate_children if scope scope.children.clear scope << n else return n end end |