internal void AddEndif(EndifPart endif) { for (int i = this.directives.Count; i > 0; i--) { IfDirective/*?*/ ifDirective = this.directives[i-1] as IfDirective; if (ifDirective == null) continue; ifDirective.endif = endif; return; } }
//^ ensures this.startOfCurrentLine == this.fragmentIndex; /// <summary> /// Parses the #endif part of an #if-#elif-#else-#endif construct, starting at the character following "endif". /// Updates the last IfDirective instance added to this.preprocessorInformation with an EndifPart. /// Leaves this.fragmentIndex pointing to the start of the first line after the #endif directive. /// </summary> private void ParseEndif() { EndifPart endif = new EndifPart(this.GetSourceLocation(this.startOfCurrentLine, this.fragmentIndex-this.startOfCurrentLine)); this.preprocessorInformation.AddEndif(endif); this.SkipPastBlanksCommentAndNewLine(); }