aboutsummaryrefslogtreecommitdiff
path: root/grammars/c++.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-05-11 12:38:58 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-05-11 12:38:58 -0700
commita93220972f8130732c8cd0267c0b14db77ac19ea (patch)
treed1141bfdcded68c8b51d9ed6a735aea5134ab4c8 /grammars/c++.bp
parent3359a804c8fe02ea4e9bc1abb7430109affdd535 (diff)
Overhaul of |-word boundaries (| is deprecated), performance
improvements for repeating matches, tweaks to the logic of word vs. id
Diffstat (limited to 'grammars/c++.bp')
-rw-r--r--grammars/c++.bp5
1 files changed, 2 insertions, 3 deletions
diff --git a/grammars/c++.bp b/grammars/c++.bp
index 33e3fb7..a48d5a2 100644
--- a/grammars/c++.bp
+++ b/grammars/c++.bp
@@ -8,7 +8,7 @@
comment: "//" .. $ / "/*" ..%\n "*/"
string: `" ..%(`\.) `"
-keyword: |(
+keyword:
"alignas" / "alignof" / "and" / "and_eq" / "asm" / "atomic_cancel" / "atomic_commit" /
"atomic_noexcept" / "auto" / "bitand" / "bitor" / "bool" / "break" / "case" / "catch" /
"char" / "char8_t" / "char16_t" / "char32_t" / "class" / "compl" / "concept" / "const" /
@@ -22,8 +22,7 @@ keyword: |(
"static_cast" / "struct" / "switch" / "synchronized" / "template" / "this" /
"thread_local" / "throw" / "true" / "try" / "typedef" / "typeid" / "typename" / "union" /
"unsigned" / "using" / "virtual" / "void" / "volatile" / "wchar_t" / "while" / "xor" / "xor_eq"
-)|
-function-def: ^_ 2+(keyword / id / anglebraces / `*) % __ parens (__`; / >(__`{))
+function-def: ^_ 2+(id / keyword / anglebraces / `*) % __ parens (__`; / >(__`{))
function: function-def __ braces
macro: ^{#define} ..$ *(<`\ \n..$)
import: ^({#include}/{#import}) __ (string / `<..`>)