Package com.google.javascript.jscomp.parsing.parser.util

Examples of com.google.javascript.jscomp.parsing.parser.util.SourceRange


  /**
   * Returns a SourceRange for a parse tree that starts at {start} and ends at the current
   * location.
   */
  private SourceRange getTreeLocation(SourcePosition start) {
    return new SourceRange(start, getTreeEndLocation());
  }
View Full Code Here


  private void skipSingleLineComment(Comment.Type type) {
    int startOffset = index;
    while (!isAtEnd() && !isLineTerminator(peekChar())) {
      nextChar();
    }
    SourceRange range = getLineNumberTable().getSourceRange(startOffset, index);
    String value = this.source.contents.substring(startOffset, index);
    recordComment(type, range, value);
  }
View Full Code Here

      nextChar();
      Comment.Type type = (index - startOffset > 4
          && this.source.contents.charAt(startOffset + 2) == '*')
          ? Comment.Type.JSDOC
          : Comment.Type.BLOCK;
      SourceRange range = getLineNumberTable().getSourceRange(
          startOffset, index);
      String value = this.source.contents.substring(
          startOffset, index);
      recordComment(type, range, value);
    } else {
View Full Code Here

  private int getColumn(int line, int offset) {
    return offset - offsetOfLine(line);
  }

  public SourceRange getSourceRange(int startOffset, int endOffset) {
    return new SourceRange(getSourcePosition(startOffset), getSourcePosition(endOffset));
  }
View Full Code Here

        || config.languageMode == LanguageMode.ECMASCRIPT6_STRICT;
  }

  double normalizeNumber(LiteralToken token) {
    String value = token.value;
    SourceRange location = token.location;
    int length = value.length();
    Preconditions.checkState(length > 0);
    Preconditions.checkState(value.charAt(0) != '-'
        && value.charAt(0) != '+');
    if (value.charAt(0) == '.') {
View Full Code Here

TOP

Related Classes of com.google.javascript.jscomp.parsing.parser.util.SourceRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.