You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: string_scanner.rb
    path of file: ./repos/kramdown/lib/kramdown/utils
    
    the code of the file until where you have to start completion: # -*- coding: utf-8; frozen_string_literal: true -*-
#
#--
# Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#

require 'strscan'

module Kram
    
      def current_line_number
        # Not using string[@previous_pos..best_pos].count('\n') because it is slower
        strscan = ::StringScanner.new(string)
        strscan.pos = @previous_pos
        old_pos = pos + 1
        @previous_line_number += 1 while strscan.skip_until(/\n/) && strscan.pos <= old_pos

        @previous_pos = (eos? ? pos : pos + 1)
        @previous_line_number
      end