$data .= $_;
- if ($is_enum && $ln =~ m/^\s*([_A-Z][^\s\}\,\=]+)\s*[\,=]?/) {
+ if ($is_enum && $ln =~ m/^\s*([_\w][\w\d_]+)\s*[\,=]?/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
}
$is_enum = 0 if ($is_enum && m/\}/);
- if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+_IO/) {
+ if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+_IO/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
next;
}
- if ($ln =~ m/^\s*#\s*define\s+([_A-Z]\S+)\s+/) {
+ if ($ln =~ m/^\s*#\s*define\s+([_\w][\w\d_]+)\s+/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
next;
}
- if ($ln =~ m/^\s*typedef\s+.*\s+([_\w]\S+);/) {
+ if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
$typedefs{$s} = $n;
next;
}
- if ($ln =~ m/^\s*enum\s+(\S+)\s+\{/
- || $ln =~ m/^\s*enum\s+(\S+)$/) {
+ if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
+ || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;
$is_enum = $1;
next;
}
- if ($ln =~ m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/
- || $ln =~ m/^\s*struct\s+([A-Za-z_]\S+)$/) {
+ if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
+ || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/) {
my $s = $1;
my $n = $1;
$n =~ tr/A-Z/a-z/;