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)); }
public void Should_parse_function_from_submodel() { var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Function()"); result.ShouldDeepEqual(SyntaxTreeExpression.Function(typeof(Model), "Function")); }
public void Should_parse_self_expression_node(string expression) { var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(string)), expression); result.ShouldDeepEqual(SyntaxTreeExpression.Self(typeof(string))); }
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"))); }
public void Should_parse_field() { var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Field"); result.ShouldDeepEqual(SyntaxTreeExpression.Field(typeof(Model), "Field")); }
public void Should_parse_property() { var result = HandlebarsExpressionParser.Parse(CreateScopes(typeof(Model)), "Property"); result.ShouldDeepEqual(SyntaxTreeExpression.Property(typeof(Model), "Property")); }
public ExpressionNode ParseExpression(string expression, SourceLocation location) { return(HandlebarsExpressionParser.Parse(this, BlockStack, location, expression, _memberLocator)); }
public ExpressionNode ParseExpression(string expression) { return(HandlebarsExpressionParser.Parse(BlockStack, expression)); }