lib/panino/plugins/parsers/javascript/jsd/js_parser.js
function line_number(index, source) {
  // To speed things up, remember the index until which we counted,
  // then next time just begin counting from there.  This way we
  // only count each line once.
  var i = start_index;
  var count = 0;
  while (i < index) {
    if (source[i] === "\n") {
      count++;
    }
    i++;
  }

  start_linenr = count + start_linenr;
  start_index = index;

  return start_linenr;
}
function line_number(index, source) {
  // To speed things up, remember the index until which we counted,
  // then next time just begin counting from there.  This way we
  // only count each line once.
  var i = start_index;
  var count = 0;
  while (i < index) {
    if (source[i] === "\n") {
      count++;
    }
    i++;
  }

  start_linenr = count + start_linenr;
  start_index = index;

  return start_linenr;
}
function line_number ( index , source ) { // To speed things up, remember the index until which we counted, // then next time just begin counting from there.  This way we // only count each line once. var i = start_index ; var count = 0 ; while ( i < index ) { if ( source [ i ] === "\n" ) { count ++ ; } i ++ ; } start_linenr = count + start_linenr ; start_index = index ; return start_linenr ; }
Given index inside input string, returns the corresponding line number
Given index inside input string returns the corresponding line number