diff --git a/doc/tools/code2doc b/doc/tools/code2doc index 10c58fa0..a1f31c1e 100755 --- a/doc/tools/code2doc +++ b/doc/tools/code2doc @@ -21,6 +21,16 @@ my ($found, $start, $first, $gotone, $idpath); $idpath = ''; while (<>) { + # Match: + # IDENT, /*:: ... */ + # IDENT = value, /*:: ... */ + # type ident; /*:: ... */ + if ($_ =~ /^(\s|[^\s=]+)*[\s*]([A-Za-z0-9_]+)(\s+=\s+[^,;]+)?[,;]\s*\/\*::\s*(.*)\s+\*\/$/) + { + print "\nid:[$idpath$2]::\n\t$4\n"; + next; + } + if ($found) { if ($_ =~ /^\s+\*\s$/) { next if $first; $_ =~ s/\s\*// if not $first; } @@ -41,12 +51,6 @@ while (<>) $_ = "$_\n$dash\n\n"; } } - elsif ($_ =~ /^(\s|[^\s=]+)*[\s*]([A-Za-z0-9_]+)(\s+=\s+[^,;]+)?[,;]\s*\/\*::\s*(.*)\s+\*\/$/) - { - print STDOUT "\n" if $gotone; - $_ = "\nid:[$idpath$2]::\n\t$4\n"; - $found = 'sorta'; $gotone = $.; - } print STDOUT "\n" and $gotone = undef if $gotone and $gotone < $.; next if not $found; $found = undef if $found eq 'sorta'; print STDOUT $_ and $start = 1;