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

CGrammar: _Static_assert: use "unless" instead of negating the condition

This commit is contained in:
Pragmatic Software 2014-07-07 09:48:25 +00:00
parent 6295b0f503
commit fbfc390b0c

View File

@ -640,10 +640,7 @@ Static_assert:
static_assert_declaration:
Static_assert '(' constant_expression ',' string ')' ';'
{
if(not $item{constant_expression} =~ s/ is / is not /) {
$item{constant_expression} .= ' is false';
}
$return = "Halt compilation and produce the diagnostic $item{string} if $item{constant_expression}.\n";
$return = "Halt compilation and produce the diagnostic $item{string} unless $item{constant_expression}.\n";
}
declaration_list: