3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

CGrammar: Fix bit-fields; remove under-construction/work-in-progress notice

This commit is contained in:
Pragmatic Software 2014-06-22 04:50:21 +00:00
parent d4cda2bbc6
commit e9b3d7e255
3 changed files with 5 additions and 5 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 => 666, BUILD_REVISION => 667,
BUILD_DATE => "2014-06-21", BUILD_DATE => "2014-06-21",
}; };

View File

@ -386,7 +386,7 @@ open $fh, '>', 'code2eng.c' or die "Could not write code: $!";
print $fh $code; print $fh $code;
close $fh; 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) { 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; $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+/ /; $output =~ s/\s+/ /;
if(not $output) { 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 # beautification
$output =~ s/the value the expression/the value of the expression/g; $output =~ s/the value the expression/the value of the expression/g;
$output =~ s/the value the address/the address/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 { sub execute {
my $timeout = shift @_; my $timeout = shift @_;

View File

@ -1042,7 +1042,7 @@ direct_declarator:
identifier ':' constant identifier ':' constant
{ {
my $bits = $item{constant} == 1 ? "$item{constant} bit" : "$item{constant} bits"; 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?) | identifier[context => 'direct_declarator'] array_declarator(s?)
{ {