From e9b3d7e25534a96bf46f0b58e65a5c571e616396 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 22 Jun 2014 04:50:21 +0000 Subject: [PATCH] CGrammar: Fix bit-fields; remove under-construction/work-in-progress notice --- PBot/VERSION.pm | 2 +- modules/c2english.pl | 6 +++--- modules/c2english/CGrammar.pm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 4f17faf4..e6941359 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 => 666, + BUILD_REVISION => 667, BUILD_DATE => "2014-06-21", }; diff --git a/modules/c2english.pl b/modules/c2english.pl index f4f00315..f4b80f42 100755 --- a/modules/c2english.pl +++ b/modules/c2english.pl @@ -386,7 +386,7 @@ open $fh, '>', 'code2eng.c' or die "Could not write code: $!"; print $fh $code; close $fh; -$output = `./c2eng.pl -P code2eng.c` if not defined $output; +$output = `./c2eng.pl code2eng.c` if not defined $output; if(not $has_function and not $has_main) { $output =~ s/Let .main. be a function taking no parameters and returning int.\s*To perform the function.\s*(return 0.)?//i; @@ -401,14 +401,14 @@ if(not $has_function and not $has_main) { $output =~ s/\s+/ /; if(not $output) { - $output = "Does not compute; I only know about C89 and valid code -- though I am still under construction.\n"; + $output = "Does not compute; I only understand valid C89 code.\n"; } # beautification $output =~ s/the value the expression/the value of the expression/g; $output =~ s/the value the address/the address/g; -print "[Work-in-progress; there will be issues!] $output\n"; +print "$output\n"; sub execute { my $timeout = shift @_; diff --git a/modules/c2english/CGrammar.pm b/modules/c2english/CGrammar.pm index 9f81f74a..8b918ea6 100644 --- a/modules/c2english/CGrammar.pm +++ b/modules/c2english/CGrammar.pm @@ -1042,7 +1042,7 @@ direct_declarator: identifier ':' constant { my $bits = $item{constant} == 1 ? "$item{constant} bit" : "$item{constant} bits"; - $return = "$item{identifier}|bit-field of $bits"; + $return = [$item{identifier}, "bit-field of $bits"]; } | identifier[context => 'direct_declarator'] array_declarator(s?) {