mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-18 06:20:41 +01:00
applets/c2english: fix issue parsing int *(foo)[5]
This commit is contained in:
parent
7a6a150067
commit
de7db72c04
@ -1,7 +1,7 @@
|
|||||||
# C-to-English Grammar
|
# C-to-English Grammar
|
||||||
# Pragmatic Software
|
# Pragmatic Software
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
# SPDX-FileCopyrightText: 2023 Pragmatic Software <pragma78@gmail.com>
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1367,6 +1367,10 @@ direct_declarator:
|
|||||||
}
|
}
|
||||||
| '(' declarator ')' array_declarator(s)
|
| '(' declarator ')' array_declarator(s)
|
||||||
{
|
{
|
||||||
|
if (ref $item{declarator} ne 'ARRAY') {
|
||||||
|
$item{declarator} = [$item{declarator}];
|
||||||
|
}
|
||||||
|
|
||||||
push @{$item{declarator}}, join(' ', @{$item{'array_declarator(s)'}});
|
push @{$item{declarator}}, join(' ', @{$item{'array_declarator(s)'}});
|
||||||
$item{declarator}
|
$item{declarator}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env perl
|
#!/usr/bin/env perl
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021 Pragmatic Software <pragma78@gmail.com>
|
# SPDX-FileCopyrightText: 2023 Pragmatic Software <pragma78@gmail.com>
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@ -47,11 +47,14 @@ sub istrue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub main {
|
sub main {
|
||||||
my ($opt_T, $opt_t, $opt_o, $opt_P);
|
my %opts;
|
||||||
getopts('TPto:');
|
|
||||||
|
|
||||||
if ($opt_T ) {
|
getopts('TPo:', \%opts);
|
||||||
$::RD_TRACE = 1;
|
|
||||||
|
|
||||||
|
if ($opts{T}) {
|
||||||
|
print STDERR "Tracing enabled.\n";
|
||||||
|
$::RD_TRACE = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$::RD_HINT = 1;
|
$::RD_HINT = 1;
|
||||||
@ -59,15 +62,15 @@ sub main {
|
|||||||
|
|
||||||
my $parser;
|
my $parser;
|
||||||
|
|
||||||
if ($opt_P or !eval { require PCGrammar }) {
|
if ($opts{P} or !eval { require PCGrammar }) {
|
||||||
precompile_grammar();
|
precompile_grammar();
|
||||||
require PCGrammar;
|
require PCGrammar;
|
||||||
}
|
}
|
||||||
|
|
||||||
$parser = PCGrammar->new or die "Bad grammar!\n";
|
$parser = PCGrammar->new or die "Bad grammar!\n";
|
||||||
|
|
||||||
if ($opt_o) {
|
if ($opts{o}) {
|
||||||
open(OUTFILE, ">>$opt_o");
|
open(OUTFILE, ">>$opts{o}");
|
||||||
*STDOUT = *OUTFILE{IO};
|
*STDOUT = *OUTFILE{IO};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4603,
|
BUILD_REVISION => 4604,
|
||||||
BUILD_DATE => "2023-01-22",
|
BUILD_DATE => "2023-01-23",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user