Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attribute annotation code for FACEs #210

Merged
merged 1 commit into from
Oct 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .pre-process-annotate-attributes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,28 @@
if (not exists $instances{$key}) {
$instances{$key} = [];
}
push(@{$instances{$key}}, { line => $line, special => $special });
if ($notes !~ m@<!-- no-annotate -->@os) {
push(@{$instances{$key}}, { line => $line, special => $special });
}
} elsif ($_ =~ m/^ <!--.*-->\n$/os) {
# ignore
} elsif ($_ eq " <dd>Any other attribute that has no namespace (see prose).</dd>\n") {
# ignore
} elsif ($_ =~ m!^ <dt>!o) {
$mode = 'bored';
} else {
die "mode=$mode saw: $_";
# ignore
}
} elsif ($mode eq 'index') {
if ($_ eq " </table>\n") {
$mode = 'end';
} elsif ($_ =~ m!^ <td> <code data-x="([^"]+)">[^<]*</code>;?\n$!os) {
$mode = 'end';
} elsif ($_ eq " <tr>\n") {
$mode = 'tr';
} else {
# ignore...
}
} elsif ($mode eq 'tr') {
if ($_ =~ m!^ <td> <(?:code|span) data-x="([^"]+)">[^<]*</(?:code|span)>;?\n$!os) {
$attributes{$1} = 1;
$mode = 'index-in';
} else {
Expand All @@ -57,7 +65,6 @@
my $description = $1;
my $altdescription = $2;
foreach my $key (keys %attributes) {
die "can't find instance of $key\n" unless exists $instances{$key} and scalar @{$instances{$key}};
foreach my $entry (@{$instances{$key}}) {
my $line = $entry->{line};
if ($entry->{special} eq 'global') {
Expand Down