Method: SyntaxTree::HashKeyFormatter::Labels#format_key

Defined in:
lib/syntax_tree/node.rb

#format_key(q, key) ⇒ Object



1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
# File 'lib/syntax_tree/node.rb', line 1405

def format_key(q, key)
  case key
  in Label
    q.format(key)
  in SymbolLiteral
    q.format(key.value)
    q.text(":")
  in DynaSymbol[parts: [TStringContent[value: LABEL] => part]]
    q.format(part)
    q.text(":")
  in DynaSymbol
    q.format(key)
    q.text(":")
  end
end