Skip to content

Commit

Permalink
Merge pull request #513 from drdrew42/clean-dev-pg-warnings
Browse files Browse the repository at this point in the history
PG warnings cleanup and minor contextFraction issue
  • Loading branch information
drgrice1 authored Feb 19, 2021
2 parents be8b0bf + 74ca762 commit bc21462
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 3 additions & 1 deletion lib/PGresource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package PGresource;
use strict;
use Exporter;
use Scalar::Util;
use UUID::Tiny ':std';
use PGcore;
our @ISA= qw( PGcore ) ;
Expand Down Expand Up @@ -60,6 +61,7 @@ sub new {
%options,
};
bless $self, $class;
Scalar::Util::weaken($self->{parent_alias});
$self->warning_message( "PGresource must be called with an alias object") unless ref($parent_alias) =~ /PGalias/;
$self->warning_message( "PGresource must be called with a name" ) unless $id;
$self->warning_message( "PGresource must be called with a type") unless $type;
Expand Down Expand Up @@ -114,4 +116,4 @@ sub fileName {
$self->{id} = $fileName if $fileName;
$self->{id};
}
1;
1;
6 changes: 3 additions & 3 deletions macros/PGML.pl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ sub ForceBreak {

sub Par {
my $self = shift; my $token = shift;
$self->End(null, shift);
$self->End(undef, shift);
$self->Item("par",$token,{noIndent => 1});
$self->{atLineStart} = $self->{ignoreNL} = 1;
$self->{indent} = $self->{actualIndent} = 0;
Expand Down Expand Up @@ -1092,7 +1092,7 @@ sub Align {
"</div>\n";
}

my %bullet = (
our %bullet = (
bullet => 'ul type="disc"',
numeric => 'ol type="1"',
alpha => 'ol type="a"',
Expand Down Expand Up @@ -1366,7 +1366,7 @@ sub Align {
return "<!-- PTX:WARNING: PGML wanted to " . $item->{align} . " align here. -->\n" . $self->string($item);
}

my %bullet = (
our %bullet = (
bullet => 'ul',
numeric => 'ol label="1."',
alpha => 'ol label="a."',
Expand Down
8 changes: 1 addition & 7 deletions macros/PGbasicmacros.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1410,19 +1410,13 @@ =head2 Display Macros
Latex2HTML => "output this in Latex2HTML mode",
)

TEX (tex_version, html_version) #obsolete

M3 (tex_version, latex2html_version, html_version) #obsolete

=cut

sub TEX {
my ($tex, $html ) = @_;
MODES(TeX => $tex, HTML => $html, HTML_tth => $html, HTML_dpng => $html);
}

sub M3 {
my($tex, $l2h, $html) = @_;
my($tex,$l2h,$html) = @_;
MODES(TeX => $tex, Latex2HTML => $l2h, HTML => $html, HTML_tth => $html, HTML_dpng => $html);
}

Expand Down
8 changes: 4 additions & 4 deletions macros/contextFraction.pl
Original file line number Diff line number Diff line change
Expand Up @@ -894,25 +894,25 @@ sub isReduced {
sub string {
my $self = shift; my $equation = shift; my $prec = shift;
my ($a,$b) = @{$self->{data}}; my $n = "";
return $a if $b == 1;
return "$a" if $b == 1;
if ($self->getFlagWithAlias("showMixedNumbers","showProperFractions") && CORE::abs($a) > $b)
{$n = int($a/$b); $a = CORE::abs($a) % $b; $n .= " " unless $a == 0}
$n .= "$a/$b" unless $a == 0 && $n ne '';
$n = "($n)" if defined $prec && $prec >= 1;
return $n;
return "$n";
}

sub TeX {
my $self = shift; my $equation = shift; my $prec = shift;
my ($a,$b) = @{$self->{data}}; my $n = "";
return $a if $b == 1;
return "$a" if $b == 1;
if ($self->getFlagWithAlias("showMixedNumbers","showProperFractions") && CORE::abs($a) > $b)
{$n = int($a/$b); $a = CORE::abs($a) % $b; $n .= " " unless $a == 0}
my $s = ""; ($a,$s) = (-$a,"-") if $a < 0;
$n .= ($self->{isHorizontal} ? "$s$a/$b" : "${s}{\\textstyle\\frac{$a}{$b}}")
unless $a == 0 && $n ne '';
$n = "\\left($n\\right)" if defined $prec && $prec >= 1;
return $n;
return "$n";
}

sub pdot {
Expand Down

0 comments on commit bc21462

Please sign in to comment.