code: def find_column(t):
      
      pos = t.lexer.lexpos
      data = t.lexer.lexdata
      last_cr = data.rfind('\n', 0, pos)
      if last_cr < 0:
          last_cr = -1
      column = pos - last_cr
      return column
docs: Get cursor position, based on previous newline