Commit 9c80c745 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

doc-rst: parse-headers: be more formal about the valid symbols

Be more formal about the valid symbols that are expected by
the parser, to match what c language expects.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 9afe5112
...@@ -34,7 +34,7 @@ while (<IN>) { ...@@ -34,7 +34,7 @@ while (<IN>) {
$data .= $_; $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 $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
...@@ -47,7 +47,7 @@ while (<IN>) { ...@@ -47,7 +47,7 @@ while (<IN>) {
} }
$is_enum = 0 if ($is_enum && m/\}/); $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 $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
...@@ -56,7 +56,7 @@ while (<IN>) { ...@@ -56,7 +56,7 @@ while (<IN>) {
next; 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 $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
...@@ -66,7 +66,7 @@ while (<IN>) { ...@@ -66,7 +66,7 @@ while (<IN>) {
next; next;
} }
if ($ln =~ m/^\s*typedef\s+.*\s+([_\w]\S+);/) { if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
my $s = $1; my $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
...@@ -75,8 +75,8 @@ while (<IN>) { ...@@ -75,8 +75,8 @@ while (<IN>) {
$typedefs{$s} = $n; $typedefs{$s} = $n;
next; next;
} }
if ($ln =~ m/^\s*enum\s+(\S+)\s+\{/ if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
|| $ln =~ m/^\s*enum\s+(\S+)$/) { || $ln =~ m/^\s*enum\s+([_\w][\w\d_]+)$/) {
my $s = $1; my $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
...@@ -87,8 +87,8 @@ while (<IN>) { ...@@ -87,8 +87,8 @@ while (<IN>) {
$is_enum = $1; $is_enum = $1;
next; next;
} }
if ($ln =~ m/^\s*struct\s+([_A-Za-z_]\S+)\s+\{/ if ($ln =~ m/^\s*struct\s+([_\w][\w\d_]+)\s+\{/
|| $ln =~ m/^\s*struct\s+([A-Za-z_]\S+)$/) { || $ln =~ m/^\s*struct\s+([[_\w][\w\d_]+)$/) {
my $s = $1; my $s = $1;
my $n = $1; my $n = $1;
$n =~ tr/A-Z/a-z/; $n =~ tr/A-Z/a-z/;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment