scan_dollar_sign

in lib/elastic_apm/sql/tokenizer.rb [133:167]


      def scan_dollar_sign
        while (peek = peek_char)
          case peek
          when DIGIT
            next_char while peek_char =~ DIGIT
          when '$', '_', ALPHA, SPACE
            
            
            
            while (char = next_char)
              case char
              when '$'
                
                snap = text
                slice = input.slice(scanner.pos, input.length)
                index = slice.index(snap)
                next unless index && index >= 0

                delta = index + snap.bytesize
                @byte_end += delta
                scanner.pos += delta
                return STRING
              when SPACE
                
                @byte_end -= char.bytesize
                return OTHER
              end
            end
          else break
          end
        end

        OTHER
      end