Esempio n. 1
0
 private void MarkExternalSource(string commentStr)
 {
     if (curLineMapping == null && commentStr.StartsWith("ExternalSource")) {
         // start of an external source mapping
         string filename;
         int lineNo;
         if (TryParseLineMapping(commentStr, out filename, out lineNo)) {
             curLineMapping = new ExternalLineMapping();
             curLineMapping.Start = endLoc;
             curLineMapping.OriginalFileName = filename;
             curLineMapping.ExternalLine = lineNo;
         }
     } else if (curLineMapping != null && commentStr.StartsWith("End ExternalSource")) {
         // end of an external source mapping
         curLineMapping = null;
     }
 }
Esempio n. 2
0
        private Token PeekToken()
        {
            if (peekedToken != null) return peekedToken;

            savedStart = tokenizer.StartLocation;
            savedEnd = tokenizer.EndLocation;
            savedExternal = tokenizer.ExternalLineLocation;

            Token p = NextToken();
            peekedToken = p;

            return p;
        }