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);
    }
 }
 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;
 }
        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);
        }
        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);
            }
        }
        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));
        }
      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;
 }
 public SourceMapEntry(SourceFileLocation sourceLocation, int targetOffset)
 {
    this.sourceLocation = sourceLocation;
    this.targetOffset   = targetOffset;
 }