From 14bc7b9c6abf0c3a5e33618566757c04ce199494 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 17 May 2022 15:56:36 +0200 Subject: [PATCH] tool/parse_cxx: handle 'alignas' specifier --- tool/parse_cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tool/parse_cxx b/tool/parse_cxx index 0513d0348e..901a31f52c 100755 --- a/tool/parse_cxx +++ b/tool/parse_cxx @@ -325,7 +325,7 @@ foreach keyword { static_cast reinterpret_cast dynamic_cast using namespace class struct union enum template const inline static virtual friend explicit - volatile case default operator new throw + volatile case default operator new throw alignas try catch continue sizeof asm override typename constexpr GENODE_RPC GENODE_RPC_THROW GENODE_RPC_INTERFACE GENODE_RPC_INTERFACE_INHERIT @@ -397,6 +397,8 @@ extract assign {=} {content block parenblk tplargs} extract attribute {__attribute__\s*§parenblk\d+°} {content block parenblk} +extract alignas {§keyalignas\d+°\s*§parenblk\d+°} {content block parenblk} + # extract identifiers extract identifier {([\w_][\w\d_]*)+(?=[^°]*(§|$))} {content parenblk block tplargs} @@ -432,8 +434,8 @@ extract classdecl { extract structdecl {§keystruct\d+°\s*§identifier\d+°\s*;} {content block} # extract classes -extract class {(§mlcomment\d+° *\n[ \t]*)?§keyclass\d+°\s*§identifier\d+°[^;]*;} {content block} -extract struct {(§mlcomment\d+° *\n[ \t]*)?§keystruct\d+°\s*§identifier\d+°[^;]*;} {content block} +extract class {(§mlcomment\d+° *\n[ \t]*)?§keyclass\d+°\s*(§alignas\d+°\s*)?§identifier\d+°[^;]*;} {content block} +extract struct {(§mlcomment\d+° *\n[ \t]*)?§keystruct\d+°\s*(§alignas\d+°\s*)?§identifier\d+°[^;]*;} {content block} extract union {(§mlcomment\d+° *\n[ \t]*)?§keyunion\d+°\s*§identifier\d+°[^;]*;} {content block} extract enum {(§mlcomment\d+° *\n[ \t]*)?§keyenum\d+°\s*[^;]*;} {content block} @@ -601,7 +603,7 @@ extract identifier {\s* extract vardecl {(§(modifier|keyunsigned)\d+°\s*)*(§(identifier|keyunsigned)\d+°)((\s|(§amper\d+°)|(§star\d+°))*(§modifier\d+°\s*)*(§funcptr\d+°)\s*(:\s*§identifier\d+°)?\s*(§assign\d+°[^;]*?)?\s*(§comma\d+°)?\s*)+;} {content classblock block} # extract variable declarations (type + any number of comma-separated variables + optional tailing comment) -extract vardecl {(§(modifier|keyunsigned)\d+°\s*)*(§(identifier|keyunsigned)\d+°)((\s|(§amper\d+°)|(§star\d+°))*(§(modifier|keyconst)\d+°\s*)*(§(identifier|array)\d+°)\s*(:\s*§identifier\d+°)?\s*(§assign\d+°[^;]*?)?(§block\d+°)?\s*(§comma\d+°)?\s*)+;} {content classblock block} +extract vardecl {(§alignas\d+°\s*)?(§(modifier|keyunsigned)\d+°\s*)*(§(identifier|keyunsigned)\d+°)((\s|(§amper\d+°)|(§star\d+°))*(§(modifier|keyconst)\d+°\s*)*(§(identifier|array)\d+°)\s*(:\s*§identifier\d+°)?\s*(§assign\d+°[^;]*?)?(§block\d+°)?\s*(§comma\d+°)?\s*)+;} {content classblock block} # extract commented variable declaration extract commentedvardecl {§vardecl\d+°\s*§m?lcomment\d+°(\s*§lcomment\d°)*} {content classblock block}