Exemple #1
0
 private void InitializeParser(SourceCode sourceCode, IEnumerable <Token> tokens, GlassScriptParserOptions options)
 {
     _sourceCode = sourceCode;
     _tokens     = tokens.Where(g => !g.IsTrivia()).ToArray();
     _options    = options;
     _index      = 0;
 }
Exemple #2
0
        public SyntaxNode ParseStatement(SourceCode sourceCode, IEnumerable <Token> tokens, GlassScriptParserOptions options)
        {
            InitializeParser(sourceCode, tokens, options);

            try
            {
                return(ParseStatement());
            }
            catch (SyntaxException)
            {
                return(null);
            }
        }