3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-23 12:29:27 +01:00

CGrammar: Fix const pointers

This commit is contained in:
Pragmatic Software 2014-06-17 23:51:55 +00:00
parent dfb7ca0abd
commit 861f095829
2 changed files with 5 additions and 10 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 => 650, BUILD_REVISION => 651,
BUILD_DATE => "2014-06-17", BUILD_DATE => "2014-06-17",
}; };

View File

@ -1209,18 +1209,13 @@ identifier:
pointer: pointer:
'*' type_qualifier_list(s) pointer(?) '*' type_qualifier_list(s) pointer(?)
{ {
$return = 'a pointer to a ' . join('', @{$item{'type_qualifier_list(s)'}}); $return = join('', @{$item{'type_qualifier_list(s)'}}) . ' pointer to a ';
$return .= ' ' . join('', @{$item{'pointer(?)'}}) if @{$item{'pointer(?)'}}; $return .= ' ' . join('', @{$item{'pointer(?)'}}) if @{$item{'pointer(?)'}};
} }
| ('*')(s) | '*' pointer(?)
{ {
my $size = $#{$item[1]} +1 ; $return .= 'pointer to a';
if ($size > 1) { $return .= ' ' . join('', @{$item{'pointer(?)'}});
while($size-- > 1) {
$return .= 'pointer to ';
}
}
$return .= 'pointer to';
} }
type_qualifier_list: type_qualifier_list: