private static RemarksDirective CreateRemarksDirective(string significantPart, MultilineScanState state) { if (significantPart.Length < 1) return null; var remarksDirective = new RemarksDirective(); foreach (string candidateName in significantPart.Split(' ')) { if (candidateName.Length == 7 || candidateName.Length == 8) { RemarksDirective.TextNameVariation textName = new RemarksDirective.TextNameVariation(candidateName); remarksDirective.CopyTextNamesVariations.Add(textName); } else if (!String.IsNullOrWhiteSpace(candidateName)) { // A string which is not a text name is an error : stop scanning here remarksDirective = null; state.InsideRemarksDirective = false; break; } } return remarksDirective; }
private static Token CreateCompilerDirectiveToken(RemarksDirective remarksDirective, TokensLine tokensLine, int start, int end) { tokensLine.ScanState.AddCopyTextNamesVariations(remarksDirective.CopyTextNamesVariations); IList<Token> originalTokens = new List<Token>(1); originalTokens.Add(new Token(TokenType.CommentLine, start,end, tokensLine)); return new CompilerDirectiveToken(remarksDirective, originalTokens, false); }