From be79e9c3467b324216688047c81315f0d3e51d24 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 1 Dec 2018 12:06:46 +0100 Subject: src: introduce simple hints on incorrect identifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # cat test.nft define test = "1.2.3.4" table ip x { chain y { ip saddr $text } } # nft -f test.nft test.nft:5:13-16: Error: unknown identifier 'text'; did you mean identifier ‘test’? ip saddr $text ^^^^ Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/rule.h') diff --git a/include/rule.h b/include/rule.h index 88fed62e..dc5e5b87 100644 --- a/include/rule.h +++ b/include/rule.h @@ -112,6 +112,8 @@ extern void symbol_bind(struct scope *scope, const char *identifier, extern int symbol_unbind(const struct scope *scope, const char *identifier); extern struct symbol *symbol_lookup(const struct scope *scope, const char *identifier); +struct symbol *symbol_lookup_fuzzy(const struct scope *scope, + const char *identifier); struct symbol *symbol_get(const struct scope *scope, const char *identifier); enum table_flags { -- cgit v1.2.3