[system] / trunk / pg / lib / Parser / BOP / underscore.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Parser/BOP/underscore.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2695 Revision 2696
68 68
69# 69#
70# Brace the index for TeX. (Not really good for multiple indices.) 70# Brace the index for TeX. (Not really good for multiple indices.)
71# 71#
72sub TeX { 72sub TeX {
73 my ($self,$precedence,$showparens,$position) = @_; 73 my ($self,$precedence,$showparens,$position,$outerRight) = @_;
74 my $bop = $self->{def}; 74 my $TeX; my $bop = $self->{def};
75 my $addparens =
76 defined($precedence) &&
77 ($showparens eq 'all' || $precedence > $bop->{precedence} ||
78 ($precedence == $bop->{precedence} &&
79 ($bop->{associativity} eq 'right' || $showparens eq 'same')));
80 my $outerRight = !$addparens && ($outerRight || $position eq 'right');
81
75 my $symbol = (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string}); 82 my $symbol = (defined($bop->{TeX}) ? $bop->{TeX} : $bop->{string});
76 $self->{lop}->TeX($bop->{precedence},$bop->{leftparens},'left'). 83 $TeX = $self->{lop}->TeX($bop->{precedence},$bop->{leftparens},'left',$outerRight).
77 $symbol.'{'.$self->{rop}->TeX.'}'; 84 $symbol.'{'.$self->{rop}->TeX.'}';
85
86 $TeX = '\left('.$TeX.'\right)' if $addparens;
87 return $TeX;
78} 88}
79 89
80# 90#
81# Perl used extract method of the Value::List object. 91# Perl used extract method of the Value::List object.
82# 92#

Legend:
Removed from v.2695  
changed lines
  Added in v.2696

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9