You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mo...@apache.org on 2001/11/14 09:20:21 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler xpath.cup

morten      01/11/14 00:20:21

  Modified:    java/src/org/apache/xalan/xsltc/compiler xpath.cup
  Log:
  Fixed a minor regression after the fix for 3592. A literal number zero was
  always interpreted as an integer zero and never as a double -0 opr 0.0.
  PR:		bugzill 4810
  Obtained from:	n/a
  Submitted by:	morten@xml.apache.org
  Reviewed by:	morten@xml.apache.org
  
  Revision  Changes    Path
  1.30      +11 -4     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
  
  Index: xpath.cup
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- xpath.cup	2001/11/09 15:14:21	1.29
  +++ xpath.cup	2001/11/14 08:20:20	1.30
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: xpath.cup,v 1.29 2001/11/09 15:14:21 tmiller Exp $
  + * @(#)$Id: xpath.cup,v 1.30 2001/11/14 08:20:20 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -732,11 +732,18 @@
   	   // bug fix 3592, num comes in as a Long rather than an Integer
   	   //               see xpath.lex, {Digit}+ rule. 
   	   long value = num.longValue();
  -	   if ( (value > Integer.MIN_VALUE) && (value < Integer.MAX_VALUE)) {
  -		RESULT = new IntExpr(num.intValue());
  +	   if ((value < Integer.MIN_VALUE) || (value > Integer.MAX_VALUE)) {
  +		RESULT = new LongExpr(num.longValue());
   	   }
   	   else {
  -		RESULT = new LongExpr(num.longValue());
  +               if (num.doubleValue() == -0)
  +                   RESULT = new RealExpr(num.doubleValue());
  +               else if (num.intValue() == 0)
  +                   RESULT = new IntExpr(num.intValue());
  +               else if (num.doubleValue() == 0.0)
  +                   RESULT = new RealExpr(num.doubleValue());
  +               else
  +                   RESULT = new IntExpr(num.intValue());
   	   }
           :}
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org