mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-23 19:22:40 +01:00
CGrammar: Fix bit-fields; remove under-construction/work-in-progress notice
This commit is contained in:
parent
d4cda2bbc6
commit
e9b3d7e255
@ -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",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -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 @_;
|
||||||
|
@ -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?)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user