Beispiel #1
0
        private void Parse()
        {
            var   builder = SyntaxList.CreateBuilder <SyntaxToken>();
            Lexer lexer   = new Lexer(Buffer.CurrentSnapshot, Buffer.CurrentSnapshot.GetText());

            builder.AddRange(lexer.Tokenize());
            Tokens = builder.ToList();
        }
Beispiel #2
0
        public SyntaxList <SyntaxToken> GetTokensInSpan(SnapshotSpan span)
        {
            var builder = SyntaxList.CreateBuilder <SyntaxToken>();

            foreach (var token in Tokens)
            {
                if (span.Contains(token.SnapshotSpan))
                {
                    builder.Add(token);
                }
            }
            return(builder.ToList());
        }