clang.kak: workaround OSX awk strange parsing of bracket expressions

For some reason `[[:alnum:]{}_]` does not match `{` when
`[{}_[:alnum:]]` does
This commit is contained in:
Maxime Coste 2018-02-07 19:40:45 +11:00
parent fbe68f375e
commit fb07e2cfcf

View File

@ -69,9 +69,9 @@ The syntaxic errors detected during parsing are shown when auto-diagnostics are
END { END {
for (id in docstrings) { for (id in docstrings) {
menu=id 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(/(^|[[: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 print id "|" docstrings[id] "|" menu
} }
}' | paste -s -d ':' - | sed -e "s/\\\\n/\\n/g; s/'/\\\\'/g") }' | paste -s -d ':' - | sed -e "s/\\\\n/\\n/g; s/'/\\\\'/g")