Esempio n. 1
0
 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;
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
 }
Esempio n. 6
0
        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);
        }