    # File lib/yard/parser/ruby/legacy/ruby_lex.rb, line 976
          def identify_gvar
            @lex_state = EXPR_END
            str = "$"

            tk = case ch = getc
                 when /[~_*$?!@\/\\;,=:<>".]/   #"
                   str << ch
                   Token(TkGVAR, str)

                 when "-"
                   str << "-" << getc
                   Token(TkGVAR, str)

                 when "&", "`", "'", "+"
                   str << ch
                   Token(TkBACK_REF, str)

                 when /[1-9]/
                   str << ch
                   while (ch = getc) =~ /[0-9]/
                     str << ch
                   end
                   ungetc
                   Token(TkNTH_REF)
                 when /\w/
                   ungetc
                   ungetc
                   return identify_identifier
                 else
                   ungetc
                   Token("$")
                 end
            tk.set_text(str)
          end