Diff for /loncom/xml/algebra/AlgParser.pm between versions 1.4 and 1.7

version 1.4, 2005/02/24 08:25:21 version 1.7, 2005/02/24 08:32:11
Line 43  my $binoper1 = '[-+=><%!#]'; Line 43  my $binoper1 = '[-+=><%!#]';
 my $openparen = '[{(\\[]';  my $openparen = '[{(\\[]';
 my $closeparen = '[})\\]]';  my $closeparen = '[})\\]]';
 my $varname = '[A-Za-z](?:_[0-9]+)?';  my $varname = '[A-Za-z](?:_[0-9]+)?';
 my $greek='alpha|bita|gamma|zita|thita|iota|kappa|lambda|mu|nu|xi|rho|sigma|tau|phi|chi|psi|omega|zepslon|zdelta|xeta|zupslon';  my $greek='alpha|(?:(?:(?:var)?(?:[tT]h))|(?:[bz])?)eta|[gG]amma|iota|kappa|[lL]ambda|mu|nu|[xX]i|(?:var)?rho|(?:var)?[sS]igma|tau|(?:var)?(?:[pP])hi|chi|[oO]mega|(?:(?:var)?(?:[eE])|(?:[uU]))psilon|[dD]elta|[pP]si|(?:var)?[pP]i';
 my $delete='zeroplace';  my $delete='zeroplace';
 my $escape='infty';  my $escape='infty';
 my $specialvalue = '(?:e|pi|d[a-z]|'.$escape.'|'.$greek.'|'.$delete.')';  my $specialvalue = '(?:'.$escape.'|'.$greek.'|'.$delete.'|d[a-z]|e)';
   
 my $numberplain = '(?:\d+(?:\.\d*)?|\.\d+)';  my $numberplain = '(?:\d+(?:\.\d*)?|\.\d+)';
 my $numberE = '(?:' . $numberplain . 'E[-+]?\d+)';  my $numberE = '(?:' . $numberplain . 'E[-+]?\d+)';
 my $number = '(?:' . $numberE . '|' . $numberplain . ')';  my $number = '(?:' . $numberE . '|' . $numberplain . ')';
Line 606  sub tolatex { Line 607  sub tolatex {
       }        }
   };    };
   /special/ && do {    /special/ && do {
     if ($args[0] eq 'pi') {return '\pi';} else {return $args[0];}        if    ($args[0] =~/($greek|$escape)/) {return '\\'.$1;}
         elsif ($args[0] =~/$delete/) {return '';}
         else { return $args[0]; }
   };    };
   /varname|(:?number$)/ && return $args[0];    /varname|(:?number$)/ && return $args[0];
   /numberE/ && do {    /numberE/ && do {

Removed from v.1.4  
changed lines
  Added in v.1.7


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>