From d244af52d84f4e8a62ac6d55bc7e051fd926590f Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 7 Jul 2014 08:39:06 +0000 Subject: [PATCH] CGrammar: Improve _Static_assert translation --- PBot/VERSION.pm | 2 +- modules/c2english/CGrammar.pm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 2655a556..ff4d45ab 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 713, + BUILD_REVISION => 714, BUILD_DATE => "2014-07-07", }; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index 1ec592a5..f76828bc 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -640,7 +640,10 @@ Static_assert: static_assert_declaration: Static_assert '(' constant_expression ',' string ')' ';' { - $return = "Declare a static assertion to produce the diagnostic $item{string} if $item{constant_expression} is false.\n"; + 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"; } declaration_list: