module RedParse::ListInNode::BareSymbolUtils
Public Instance Methods
baresym2str(node)
click to toggle source
# File lib/redparse/node.rb, line 4960 def baresym2str(node) case node when MethNameToken; node.ident when VarNode; node when LiteralNode case node.val when Symbol node.val.to_s when StringNode; node.val # when StringToken: StringNode.new(node.val) else fail end end end
str2parsetree(str,o)
click to toggle source
# File lib/redparse/node.rb, line 4988 def str2parsetree(str,o) if String===str str=str.chop if /^[!~]@$/===str [:lit, str.to_sym] else result=str.parsetree(o) result[0]=:dsym result end end
str_unparse(str,o)
click to toggle source
# File lib/redparse/node.rb, line 4975 def str_unparse(str,o) case str when VarNode; str.ident when "~@"; str when String str.to_sym.inspect #what if str isn't a valid method or operator name? should be quoted when StringNode ":"+str.unparse(o) else fail end end