3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

CGrammar: correct order of sizeof unary expressions

This commit is contained in:
Pragmatic Software 2014-07-07 10:24:15 +00:00
parent fbfc390b0c
commit 4a646f61c9
2 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@ 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 => 715, BUILD_REVISION => 717,
BUILD_DATE => "2014-07-07", BUILD_DATE => "2014-07-07",
}; };

View File

@ -978,12 +978,12 @@ unary_expression:
$return = $item{unary_operator} . $item{cast_expression}; $return = $item{unary_operator} . $item{cast_expression};
} }
} }
| 'sizeof' unary_expression[context => 'sizeof']
{ $return = "the size of $item{unary_expression}"; }
| 'sizeof' '(' type_name[context => 'sizeof'] ')' | 'sizeof' '(' type_name[context => 'sizeof'] ')'
{ $return = "the size of the type $item{type_name}"; } { $return = "the size of the type $item{type_name}"; }
| 'sizeof' '(' assignment_expression[context => 'sizeof'] ')' | 'sizeof' '(' assignment_expression[context => 'sizeof'] ')'
{ $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']
{ $return = "the size of $item{unary_expression}"; }
| Alignof '(' type_name ')' | Alignof '(' type_name ')'
{ $return = "the alignment of the type $item{type_name}"; } { $return = "the alignment of the type $item{type_name}"; }