Created
October 29, 2025 17:44
-
-
Save elbeno/8180c41646c1a77378e2ab9655293533 to your computer and use it in GitHub Desktop.
Count C++ keywords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| keywords=("alignas" "alignof" "asm" "auto" "break" "case" "catch" "class" "concept" "const" "consteval" "constexpr" "constinit" "continue" "decltype" "default" "delete" "do" "else" "enum" "explicit" "for" "friend" "goto" "if" "inline" "final" "mutable" "namespace" "noexcept" "operator" "override" "private" "protected" "public" "requires" "return" "sizeof" "static" "static"_"assert" "struct" "switch" "template" "this" "thread_local" "throw" "try" "typedef" "typeid" "typename" "union" "using" "virtual" "volatile" "while") | |
| for k in "${keywords[@]}" | |
| do | |
| git grep -c -i "\b$k\b" include/*.hpp | cut -d':' -f2 | awk -v kw="$k" '{sum += $1} END {printf "%s %d\n", kw, sum}' | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment