示例#1
0
        public void Should_parse_as_late_bound_when_model_type_is_not_known <T>(T model)
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(T)), "Name");

            result.ShouldDeepEqual(SyntaxTreeExpression.LateBound("Name", MemberLocator.Default, false, ExpressionScope.CurrentModelOnStack));
        }
示例#2
0
        public void Should_parse_function_from_submodel()
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Function()");

            result.ShouldDeepEqual(SyntaxTreeExpression.Function(typeof(Model), "Function"));
        }
示例#3
0
        public void Should_parse_self_expression_node(string expression)
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(string)), expression);

            result.ShouldDeepEqual(SyntaxTreeExpression.Self(typeof(string)));
        }
示例#4
0
        public void Should_parse_property_from_submodel()
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "SubModel.SubProperty");

            result.ShouldDeepEqual(SyntaxTreeExpression.SubModel(SyntaxTreeExpression.Property(typeof(Model), "SubModel"), SyntaxTreeExpression.Property(typeof(SubModel), "SubProperty")));
        }
示例#5
0
        public void Should_parse_field()
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Field");

            result.ShouldDeepEqual(SyntaxTreeExpression.Field(typeof(Model), "Field"));
        }
示例#6
0
        public void Should_parse_property()
        {
            var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Property");

            result.ShouldDeepEqual(SyntaxTreeExpression.Property(typeof(Model), "Property"));
        }
示例#7
0
 public ExpressionNode ParseExpression(string expression, SourceLocation location)
 {
     return(HandlebarsExpressionParser.Parse(this, BlockStack, location, expression, _memberLocator));
 }
示例#8
0
 public ExpressionNode ParseExpression(string expression)
 {
     return(HandlebarsExpressionParser.Parse(BlockStack, expression));
 }