コード例 #1
0
 public void updatePreviousSourceLocation(SourceFileLocation sourceLocation) 
 {
    previousSourceLine = sourceLocation.getLine();
    previousSourceColumn = sourceLocation.getColumn();
    String sourceUrl = sourceLocation.getSourceUrl();
    previousSourceUrlIndex = indexOf(sourceUrlList, sourceUrl, sourceUrlMap);
    String sourceName = sourceLocation.getSourceName();
    if (sourceName != null) 
    {
       previousSourceNameIndex = indexOf(sourceNameList, sourceName, sourceNameMap);
    }
 }
コード例 #2
0
 bool sameAsPreviousLocation(SourceFileLocation sourceLocation) 
 {
    if (sourceLocation == null) {
       return true;
    }
    int sourceUrlIndex =
       indexOf(sourceUrlList, sourceLocation.getSourceUrl(), sourceUrlMap);
    return
       sourceUrlIndex == previousSourceUrlIndex &&
       sourceLocation.getLine() == previousSourceLine &&
       sourceLocation.getColumn() == previousSourceColumn;
 }
コード例 #3
0
        bool sameAsPreviousLocation(SourceFileLocation sourceLocation)
        {
            if (sourceLocation == null)
            {
                return(true);
            }
            int sourceUrlIndex =
                indexOf(sourceUrlList, sourceLocation.getSourceUrl(), sourceUrlMap);

            return
                (sourceUrlIndex == previousSourceUrlIndex &&
                 sourceLocation.getLine() == previousSourceLine &&
                 sourceLocation.getColumn() == previousSourceColumn);
        }
コード例 #4
0
        public void updatePreviousSourceLocation(SourceFileLocation sourceLocation)
        {
            previousSourceLine   = sourceLocation.getLine();
            previousSourceColumn = sourceLocation.getColumn();
            String sourceUrl = sourceLocation.getSourceUrl();

            previousSourceUrlIndex = indexOf(sourceUrlList, sourceUrl, sourceUrlMap);
            String sourceName = sourceLocation.getSourceName();

            if (sourceName != null)
            {
                previousSourceNameIndex = indexOf(sourceNameList, sourceName, sourceNameMap);
            }
        }
コード例 #5
0
        public void addMapping(int targetOffset, SourceFileLocation sourceLocation)
        {
            if (!entries.isEmpty && sameLine(targetOffset, entries.last.targetOffset))
            {
                if (sameAsPreviousLocation(sourceLocation))
                {
                    // The entry points to the same source location as the previous entry in
                    // the same line, hence it is not needed for the source map.
                    //
                    // TODO(zarah): Remove this check and make sure that [addMapping] is not
                    // called for this position. Instead, when consecutive lines in the
                    // generated code point to the same source location, record this and use
                    // it to generate the entries of the source map.
                    return;
                }
            }

            if (sourceLocation != null)
            {
                updatePreviousSourceLocation(sourceLocation);
            }
            entries.add(new SourceMapEntry(sourceLocation, targetOffset));
        }
コード例 #6
0
      public void addMapping(int targetOffset, SourceFileLocation sourceLocation) 
      {
         if (!entries.isEmpty && sameLine(targetOffset, entries.last.targetOffset)) 
         {
            if (sameAsPreviousLocation(sourceLocation)) 
            {
               // The entry points to the same source location as the previous entry in
               // the same line, hence it is not needed for the source map.
               //
               // TODO(zarah): Remove this check and make sure that [addMapping] is not
               // called for this position. Instead, when consecutive lines in the
               // generated code point to the same source location, record this and use
               // it to generate the entries of the source map.
               return;
            }
         }

         if (sourceLocation != null) 
         {
            updatePreviousSourceLocation(sourceLocation);
         }
         entries.add(new SourceMapEntry(sourceLocation, targetOffset));
      }
コード例 #7
0
 public SourceMapEntry(SourceFileLocation sourceLocation, int targetOffset)
 {
     this.sourceLocation = sourceLocation;
     this.targetOffset   = targetOffset;
 }
コード例 #8
0
 public SourceMapEntry(SourceFileLocation sourceLocation, int targetOffset)
 {
    this.sourceLocation = sourceLocation;
    this.targetOffset   = targetOffset;
 }