mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-25 04:02:37 +01:00
CGrammar: _Static_assert: use "unless" instead of negating the condition
This commit is contained in:
parent
6295b0f503
commit
fbfc390b0c
@ -640,10 +640,7 @@ Static_assert:
|
|||||||
static_assert_declaration:
|
static_assert_declaration:
|
||||||
Static_assert '(' constant_expression ',' string ')' ';'
|
Static_assert '(' constant_expression ',' string ')' ';'
|
||||||
{
|
{
|
||||||
if(not $item{constant_expression} =~ s/ is / is not /) {
|
$return = "Halt compilation and produce the diagnostic $item{string} unless $item{constant_expression}.\n";
|
||||||
$item{constant_expression} .= ' is false';
|
|
||||||
}
|
|
||||||
$return = "Halt compilation and produce the diagnostic $item{string} if $item{constant_expression}.\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declaration_list:
|
declaration_list:
|
||||||
|
Loading…
Reference in New Issue
Block a user