assignable (RubyParser)

    # File lib/ruby_parser_extras.rb, line 176
      def assignable(lhs, value = nil)
        id = lhs.to_sym
        id = id.to_sym if Sexp === id

        raise SyntaxError, "Can't change the value of #{id}" if
          id.to_s =~ /^(?:self|nil|true|false|__LINE__|__FILE__)$/

        result = case id.to_s
                 when /^@@/ then
                   asgn = in_def || in_single > 0
                   s((asgn ? :cvasgn : :cvdecl), id)
                 when /^@/ then
                   s(:iasgn, id)
                 when /^\$/ then
                   s(:gasgn, id)
                 when /^[A-Z]/ then
                   s(:cdecl, id)
                 else
                   case self.env[id]
                   when :lvar then
                     s(:lasgn, id)
                   when :dvar, nil then
                     if self.env.current[id] == :dvar then
                       s(:lasgn, id)
                     elsif self.env[id] == :dvar then
                       self.env.use(id)
                       s(:lasgn, id)
                     elsif ! self.env.dynamic? then
                       s(:lasgn, id)
                     else
                       s(:lasgn, id)
                     end
                   else
                     raise "wtf? unknown type: #{self.env[id]}"
                   end
                 end

        self.env[id] ||= :lvar

        result << value if value

        return result
      end