aboutsummaryrefslogtreecommitdiffstats
path: root/cli_main.h
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-12-26 03:42:07 +0000
committerJoão Valverde <j@v6e.pt>2022-12-27 02:21:06 +0000
commitb19bed43d19207355520b360cb7e7ed41a7b68c2 (patch)
tree3a26a1a5b072eb78dd6e50da32bd688de4521918 /cli_main.h
parent6399f724d9c8f7926ba7bbd16eceb503f11b8602 (diff)
dfilter: Allow constants as the first or only argument to min/max
The strategy here is to delay resolving literals to values until we have looked at the entire argument list. Also we will try to commute the relation in a comparison if we do not have a type for the return value of the function, like any other constant. Before: Filter: max(1,_ws.ftypes.int8) == 1 dftest: Argument '1' is not valid for max() max(1,_ws.ftypes.int8) == 1 ^ After: Filter: max(1,_ws.ftypes.int8) == 1 Syntax tree: 0 TEST_ANY_EQ: 1 FUNCTION(max#2): 2 FVALUE(1 <FT_INT8>) 2 FIELD(_ws.ftypes.int8 <FT_INT8>) 1 FVALUE(1 <FT_INT8>) Instructions: 00000 STACK_PUSH 1 <FT_INT8> 00001 READ_TREE _ws.ftypes.int8 <FT_INT8> -> reg#1 00002 IF_FALSE_GOTO 3 00003 STACK_PUSH reg#1 00004 CALL_FUNCTION max(reg#1, 1 <FT_INT8>) -> reg#0 00005 STACK_POP 2 00006 IF_FALSE_GOTO 8 00007 ANY_EQ reg#0 == 1 <FT_INT8> 00008 RETURN
Diffstat (limited to 'cli_main.h')
0 files changed, 0 insertions, 0 deletions