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

CGrammar: Fix anchoring of reserved rule

This commit is contained in:
Pragmatic Software 2014-06-21 06:40:03 +00:00
parent 0b941bf771
commit a388994d54
2 changed files with 6 additions and 6 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 => 664, BUILD_REVISION => 665,
BUILD_DATE => "2014-06-20", BUILD_DATE => "2014-06-20",
}; };

View File

@ -567,6 +567,7 @@ declaration_list:
declaration: declaration:
declaration_specifiers init_declarator_list(?) ';' declaration_specifiers init_declarator_list(?) ';'
{ {
print STDERR "wtf2\n", ::Dumper \%item;
my @init_list = defined $item{'init_declarator_list(?)'}->[0] ? @{$item{'init_declarator_list(?)'}->[0]} : (''); my @init_list = defined $item{'init_declarator_list(?)'}->[0] ? @{$item{'init_declarator_list(?)'}->[0]} : ('');
my $init_declaration_list; my $init_declaration_list;
@ -1198,6 +1199,7 @@ declaration_specifiers:
} }
| comment(?) type_specifier declaration_specifiers(?) | comment(?) type_specifier declaration_specifiers(?)
{ {
print STDERR "wtf1\n", ::Dumper \%item;
my $decl_spec = join(' ', @{$item{'declaration_specifiers(?)'}}); my $decl_spec = join(' ', @{$item{'declaration_specifiers(?)'}});
$return = join('',@{$item{'comment(?)'}}); $return = join('',@{$item{'comment(?)'}});
$return .= "$decl_spec " if $decl_spec; $return .= "$decl_spec " if $decl_spec;
@ -1444,9 +1446,7 @@ string:
/(?:\"(?:\\\"|(?!\").)*\")/ /(?:\"(?:\\\"|(?!\").)*\")/
reserved: reserved:
('int' | 'double' | 'short' | 'volatile' | 'register' | 'float' | 'signed' /(auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto
| 'unsigned' | 'char' | 'for' | 'if' | 'switch' | 'while' | 'do' | 'case' |if|int|long|register|return|signed|sizeof|short|static|struct|switch|typedef
| 'extern' | 'void' | 'exit' | 'return' | 'auto' | 'break' | 'const' |union|unsigned|void|volatile|while)\b/x
| 'continue' | 'default' | 'else' | 'enum' | 'struct' | 'goto' | 'long'
| 'register' | 'sizeof' | 'static' | 'typedef' | 'union') /\z/