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

Small fixes to schema docs #2214

Merged
merged 1 commit into from
Sep 26, 2023
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
8 changes: 5 additions & 3 deletions lib/LaTeXML/Common/Model/RelaxNG.pm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ sub filterNames {
&& ((($name =~ /^!(.*)$/) && !(defined $$hash{$1})) # Negated name, but name not present?
|| (!defined $$hash{ '!' . $name }))) { # Or negation of name not present
$filtered{$name} = 1; } }
return sort keys %filtered; }
return (sort keys %filtered); }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new parens around sort were motivated by Perl Critic complaining loudly that sort should not follow a return (severity 5, docs)


# Return two hashrefs for content & attributes
sub extractContent {
Expand Down Expand Up @@ -476,7 +476,10 @@ sub simplify {
elsif (($combination eq 'group') && ($prevc ne 'group')) { # Use old combination!?!?!?!?
$combination = $prevc; } }
$$self{defs}{$qname} = simplifyCombination(['combination', $combination,
($prev ? @$prev : ()), @xargs]);
# careful, if $prev is a triple [$op,$name,@stuff] and we flatten it,
# we should not treat $op and $name as @stuff.
# We should either drop them, or not flatten at all. Drop for now.
($prev ? @$prev[2 .. $#{$prev}] : ()), @xargs]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea is that simplifyCombination is supposed to evolve to give a "good" description, but it clearly isn't there yet. I expect that probably $prev would have been more correct than @$prev and better than throwing away the operator. OTOH, that leaves simplifyCombination to deal with the initial case where the extra items are empty (that puts a "()" into the summary). And none of the variants are generating sensible descriptions for the tricky cases svg, xhtml:* and such; that ought to be our goal, I think.

$$self{def_combiner}{$qname} = $combination;
return ([$op, $qname, @args]); } }
else {
Expand Down Expand Up @@ -708,7 +711,6 @@ sub getSymbolUses {
my @uses = sort keys %$uses;
@uses = grep { !/\bSVG./ } @uses if $SKIP_SVG; # !!!
return join(', ',
(map { /^pattern:[^:]*:(.*)$/ ? ('\patternref{' . cleanTeX($1) . '}') : () } @uses),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops!

(map { /^pattern:[^:]*:(.*)$/ ? ('\patternref{' . cleanTeX($1) . '}') : () } @uses),
(map { /^element:(.*)$/ ? ('\elementref{' . cleanTeXName($1) . '}') : () } @uses)); }
else {
Expand Down
Loading