From fb07e2cfcfd2888c0553a95cf5cedde95b12f310 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 7 Feb 2018 19:40:45 +1100 Subject: [PATCH] clang.kak: workaround OSX awk strange parsing of bracket expressions For some reason `[[:alnum:]{}_]` does not match `{` when `[{}_[:alnum:]]` does --- rc/extra/clang.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index 6d6dd0a0..46035879 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -69,9 +69,9 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are END { for (id in docstrings) { menu=id - gsub(/(^|[^[:alnum:]_])(operator|new|delete)($|[^[:alnum:]{}_]+)/, "{keyword}&{}", menu) + gsub(/(^|[^[:alnum:]_])(operator|new|delete)($|[^{}_[:alnum:]]+)/, "{keyword}&{}", menu) gsub(/(^|[[:space:]])(int|size_t|bool|char|unsigned|signed|long)($|[[:space:]])/, "{type}&{}", menu) - gsub(/[^[:alnum:]{}_]+/, "{operator}&{}", menu) + gsub(/[^{}_[:alnum:]]+/, "{operator}&{}", menu) print id "|" docstrings[id] "|" menu } }' | paste -s -d ':' - | sed -e "s/\\\\n/\\n/g; s/'/\\\\'/g")