private void ParseSymbol(ICollection<CodeLexem> res, ref SourcePart text) { int index = text.IndexOfAny(XmlSymbol); if (index != 0) return; res.Add(new CodeLexem(LexemType.Symbol, text.Substring(0, 1))); text = text.Substring(1); }
protected string CutString(ref SourcePart text, int count) { if (count == 0) return string.Empty; previousSimbol = text[count - 1]; var result = text.Substring(0, count); text = text.Substring(count); return result; }
private void ParseSymbol(ICollection <CodeLexem> res, ref SourcePart text) { int index = text.IndexOfAny(XmlSymbol); if (index != 0) { return; } res.Add(new CodeLexem(LexemType.Symbol, text.Substring(0, 1))); text = text.Substring(1); }
protected string CutString(ref SourcePart text, int count) { if (count == 0) { return(string.Empty); } previousSimbol = text[count - 1]; var result = text.Substring(0, count); text = text.Substring(count); return(result); }
protected void TryExtractTo(List<CodeLexem> res, ref SourcePart text, string lex, LexemType type, string except = null) { var index = text.IndexOf(lex); if (except != null) { while (index >= 0 && text.Substring(0, index + 1).EndsWith(except)) { index = text.IndexOf(lex, index + 1); } } if (index < 0) return; LineBreaks(res, ref text, index + lex.Length, type); }
protected void TryExtractTo(List <CodeLexem> res, ref SourcePart text, string lex, LexemType type, string except = null) { var index = text.IndexOf(lex); if (except != null) { while (index >= 0 && text.Substring(0, index + 1).EndsWith(except)) { index = text.IndexOf(lex, index + 1); } } if (index < 0) { return; } LineBreaks(res, ref text, index + lex.Length, type); }