The lex scanner for the cube package has an apparent error in its
pattern for matching floating point numbers. It doesn't except cases
where there is no digit between a sign and a decimal point. For example
-.1 is not matched by the pattern.

I have attached a patch to cubeparse.l and the regression differences.

P.S. I still plan to submit enhancement patches for cube before the
end of the week, but as this is a bug fix I thought it should really
go in separately.
*** cubescan.l  Tue Aug 27 09:04:16 2002
--- ../cube/cubescan.l  Tue Jul 30 11:33:08 2002
***************
*** 34,40 ****
  
  n            [0-9]+
  integer      [+-]?{n}
! real         [+-]?({n}\.{n}?|\.{n})
  float        ({integer}|{real})([eE]{integer})?
  
  %%
--- 34,40 ----
  
  n            [0-9]+
  integer      [+-]?{n}
! real         [+-]?({n}\.{n}?)|(\.{n})
  float        ({integer}|{real})([eE]{integer})?
  
  %%
*** ./expected/cube.out Sun Aug 25 12:48:54 2002
--- ./results/cube.out  Tue Aug 27 09:04:35 2002
***************
*** 43,49 ****
  (1 row)
  
  SELECT '-.1'::cube AS cube;
! ERROR:  parse error, expecting `FLOAT' or `O_PAREN' or `O_BRACKET' at or before 
position 2, character ('.', \056), input: '-.1'
  
  SELECT '1.0'::cube AS cube;
   cube 
--- 43,52 ----
  (1 row)
  
  SELECT '-.1'::cube AS cube;
!   cube  
! --------
!  (-0.1)
! (1 row)
  
  SELECT '1.0'::cube AS cube;
   cube 

======================================================================


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly

Reply via email to