From: Francesco Chemolli Date: Sat, 5 Sep 2015 11:27:59 +0000 (+0200) Subject: Update mk-string-arrays.awk to support c++-style enums X-Git-Tag: SQUID_4_0_1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4ee1b0d8970bbcb2e332377cdc95a269a8a2a119;p=thirdparty%2Fsquid.git Update mk-string-arrays.awk to support c++-style enums --- diff --git a/src/mk-string-arrays.awk b/src/mk-string-arrays.awk index a1f331ae0c..840badd097 100644 --- a/src/mk-string-arrays.awk +++ b/src/mk-string-arrays.awk @@ -34,6 +34,16 @@ BEGIN { # Skip all lines outside of typedef {} /^typedef/ { codeSkip = 0; next } +/^enum class / { + codeSkip = 0 + type = $3 + next; +} +/^enum / { + codeSkip = 0 + type = $2 + next; +} codeSkip == 1 { next } /^[ \t]*[A-Z]/ { @@ -50,11 +60,19 @@ codeSkip == 1 { next } next } +/};/ { + codeSkip = 1; +} + /^} / { split($2, t, ";") # remove ; - type = t[1] - codeSkip = 1 + if (!type) + type = t[1] + codeSkip = 1 + next +} +END { if (sbuf) print "#include \"SBuf.h\"" print "#include \"" nspath type ".h\"" @@ -71,5 +89,4 @@ codeSkip == 1 { next } print "\t" Element[i] print "};" if (namespace) print "}; // namespace " namespace - next }