Ejemplo n.º 1
0
 internal virtual object Parse(string formula, RangeAddress rangeAddress)
 {
     using (var scope = _parsingContext.Scopes.NewScope(rangeAddress))
     {
         var tokens = _lexer.Tokenize(formula);
         var graph  = _graphBuilder.Build(tokens);
         if (graph.Expressions.Count() == 0)
         {
             return(null);
         }
         return(_compiler.Compile(graph.Expressions).Result);
     }
 }
Ejemplo n.º 2
0
        public void BuildShouldNotUseStringIdentifyersWhenBuildingStringExpression()
        {
            var tokens = new List <Token>
            {
                new Token("'", TokenType.String),
                new Token("abc", TokenType.StringContent),
                new Token("'", TokenType.String)
            };

            var result = _graphBuilder.Build(tokens);

            Assert.AreEqual(1, result.Expressions.Count());
        }