3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 18:39:35 +01:00

CGrammar: Add C11's _Alignof

This commit is contained in:
Pragmatic Software 2014-07-07 06:45:50 +00:00
parent 162e264e82
commit 9623086310
2 changed files with 9 additions and 3 deletions

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script # These are set automatically by the build/commit script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 711, BUILD_REVISION => 712,
BUILD_DATE => "2014-07-05", BUILD_DATE => "2014-07-06",
}; };
1; 1;

View File

@ -973,6 +973,12 @@ unary_expression:
{ $return = "the size of the type of the expression ($item{assignment_expression})"; } { $return = "the size of the type of the expression ($item{assignment_expression})"; }
| 'sizeof' unary_expression[context => 'sizeof'] | 'sizeof' unary_expression[context => 'sizeof']
{ $return = "the size of $item{unary_expression}"; } { $return = "the size of $item{unary_expression}"; }
| Alignof '(' type_name ')'
{ $return = "the alignment of the type $item{type_name}"; }
Alignof:
'_Alignof'
| 'alignof'
postfix_productions: postfix_productions:
'(' argument_expression_list(?) ')' postfix_productions[context => 'function call'](?) '(' argument_expression_list(?) ')' postfix_productions[context => 'function call'](?)
@ -1824,6 +1830,6 @@ string:
reserved: reserved:
/(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto /(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto
|if|inline|int|long|register|restrict|return|short|signed|sizeof|static|struct|switch|typedef |if|inline|int|long|register|restrict|return|short|signed|sizeof|static|struct|switch|typedef
|union|unsigned|void|volatile|while|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic |union|unsigned|void|volatile|while|_Alignas|alignas|_Alignof|alignof|_Atomic|_Bool|_Complex|_Generic
|_Imaginary|_Noreturn|_Static_assert|_Thread_local)\b/x |_Imaginary|_Noreturn|_Static_assert|_Thread_local)\b/x