src/syntax/Scanner.js
function peekTokenNoLineTerminator() {
  var t = peekToken();
  var start = lastToken.location.end.offset;
  var end = t.location.start.offset;
  for (var i = start; i < end; i++) {
    var code = input.charCodeAt(i);
    if (isLineTerminator(code))
      return null;

    // If we have a block comment we need to skip it since new lines inside
    // the comment are not significant.
    if (code === 47) {  // '/'
      code = input.charCodeAt(++i);
      // End of line comments always mean a new line is present.
      if (code === 47)  // '/'
        return null;
      i = input.indexOf('*/', i) + 2;
    }
  }
  return t;
}
function peekTokenNoLineTerminator() {
  var t = peekToken();
  var start = lastToken.location.end.offset;
  var end = t.location.start.offset;
  for (var i = start; i < end; i++) {
    var code = input.charCodeAt(i);
    if (isLineTerminator(code))
      return null;

    // If we have a block comment we need to skip it since new lines inside
    // the comment are not significant.
    if (code === 47) {  // '/'
      code = input.charCodeAt(++i);
      // End of line comments always mean a new line is present.
      if (code === 47)  // '/'
        return null;
      i = input.indexOf('*/', i) + 2;
    }
  }
  return t;
}
function peekTokenNoLineTerminator ( ) { var t = peekToken ( ) ; var start = lastToken . location . end . offset ; var end = t . location . start . offset ; for ( var i = start ; i < end ; i ++ ) { var code = input . charCodeAt ( i ) ; if ( isLineTerminator ( code ) ) return null ; // If we have a block comment we need to skip it since new lines inside // the comment are not significant. if ( code === 47 ) { // '/' code = input . charCodeAt ( ++ i ) ; // End of line comments always mean a new line is present. if ( code === 47 ) // '/' return null ; i = input . indexOf ( '*/' , i ) + 2 ; } } return t ; }
Peeks the next token ensuring that there is no line terminator before it.
This is done by checking the preceding characters for new lines.
@return {Token} This returns null if no token is found before the next
line terminator.
Peeks the next token ensuring that there is no line terminator before it . This is done by checking the preceding characters for new lines .