From cc1099a04169b768cb4803686ee20423a6d3fede Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 3 Jul 2023 17:00:58 +0200 Subject: Filter: Implement multiple dispatch for methods - Extend method descriptors with type signature - Daisy chain method descriptors for the same symbol - Dispatch methods for same symbol based on type signature - Split add/delete/filter operations to multiple methods - Replace ad-hoc dispatch of old-style syntax with scope-based dispatch - Also change method->arg_num to count initial arg It still needs some improvements, like better handling of untyped expressions and better error reporting when no dispatch can be done. The multiple dispatch could also be extended to dispatch regular function-like expressions in a uniform way. --- conf/cf-lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'conf') diff --git a/conf/cf-lex.l b/conf/cf-lex.l index c4760e40..dcd54b81 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -687,7 +687,7 @@ cf_lex_symbol(const char *data) return ENUM; } case SYM_METHOD: - return sym->method->arg_num ? CF_SYM_METHOD_ARGS : CF_SYM_METHOD_BARE; + return (sym->method->arg_num > 1) ? CF_SYM_METHOD_ARGS : CF_SYM_METHOD_BARE; case SYM_VOID: return CF_SYM_UNDEFINED; default: -- cgit v1.2.3