Lines Matching refs:ctx
9 static int test(struct parse_ctx *ctx, const char *e, double val2) in test() argument
13 if (expr__parse(&val, ctx, &e)) in test()
25 struct parse_ctx ctx; in test__expr() local
28 expr__ctx_init(&ctx); in test__expr()
29 expr__add_id(&ctx, "FOO", 1); in test__expr()
30 expr__add_id(&ctx, "BAR", 2); in test__expr()
32 ret = test(&ctx, "1+1", 2); in test__expr()
33 ret |= test(&ctx, "FOO+BAR", 3); in test__expr()
34 ret |= test(&ctx, "(BAR/2)%2", 1); in test__expr()
35 ret |= test(&ctx, "1 - -4", 5); in test__expr()
36 ret |= test(&ctx, "(FOO-1)*2 + (BAR/2)%2 - -4", 5); in test__expr()
37 ret |= test(&ctx, "1-1 | 1", 1); in test__expr()
38 ret |= test(&ctx, "1-1 & 1", 0); in test__expr()
39 ret |= test(&ctx, "min(1,2) + 1", 2); in test__expr()
40 ret |= test(&ctx, "max(1,2) + 1", 3); in test__expr()
41 ret |= test(&ctx, "1+1 if 3*4 else 0", 2); in test__expr()
47 ret = expr__parse(&val, &ctx, &p); in test__expr()
51 ret = expr__parse(&val, &ctx, &p); in test__expr()