Ticket #131: numeric-ovfl.patch
File numeric-ovfl.patch, 4.6 KB (added by hopscc, 16 years ago) |
---|
-
Source/CobraTokenizer.cobra
470 470 catch FormatException 471 471 assert false, 'not expecting to get here given regex' 472 472 catch OverflowException 473 assert false, 'TODO'473 .throwError('Float range overflow in parse of float literal [tok.text].') 474 474 tok.which = 'FLOAT_LIT' 475 475 tok.info = size 476 476 return tok … … 492 492 catch FormatException 493 493 assert false, 'not expecting to get here given regex' 494 494 catch OverflowException 495 assert false, 'TODO: DECIMAL_LIT Overflow'495 .throwError('Decimal range overflow in parse of decimal literal [tok.text].') 496 496 return tok 497 497 498 498 def onFRACTIONAL_LIT(tok as IToken) as IToken? … … 502 502 catch FormatException 503 503 assert false, 'not expecting to get here given regex' 504 504 catch OverflowException 505 assert false, 'TODO: FRACTIONAL_LIT Overflow'505 .throwError('overflow in parse of Fractional Literal [tok.text].') 506 506 return tok 507 507 508 508 def onINTEGER_LIT(tok as IToken) as IToken? … … 511 511 catch FormatException 512 512 assert false, 'not expecting to get here given regex' 513 513 catch OverflowException 514 assert false, 'TODO: INTEGER_LIT Overflow'514 .throwError('Integer range overflow in parse of integer literal [tok.text].') 515 515 return tok 516 516 517 517 def onINTEGER_LIT_SIGN(tok as IToken) as IToken? … … 566 566 catch FormatException 567 567 assert false, 'not expecting to get here given regex' 568 568 catch OverflowException 569 assert false, 'TODO'569 .throwError('Integer range overflow in parse of sized or signed integer literal [tok.text].') 570 570 tok.which = 'INTEGER_LIT' 571 571 tok.info = if(signed, -1, +1) * size 572 572 … … 615 615 catch FormatException 616 616 assert false, 'not expecting to get here given regex' 617 617 catch OverflowException 618 assert false, 'TODO: HEX_LIT Overflow (int)'618 .throwError('Integer range overflow in parse of hex literal [tok.text].') 619 619 tok.which = 'INTEGER_LIT' 620 620 tok.info = 32 # unsigned 621 621 return tok -
Tests/820-errors/600-other/150-overflow/int-ovfl.cobra
1 class IntOvfl 2 def main is shared 3 /# decimal 4 int (same as int32) 5 int8 6 int64 7 uint8 8 hex 9 float 10 float32 11 #/ 12 i = 2_147_483_648 # .error. Integer range Overflow -
Tests/820-errors/600-other/150-overflow/dec-ovfl.cobra
1 class DecOvfl 2 def main is shared 3 /# decimal 4 int 5 int8 6 int64 7 uint8 8 hex 9 float 10 float32 11 #/ 12 a = 80_228_162_514_264_337_593_543_950_335.1d # .error. Decimal range overflow -
Tests/820-errors/600-other/150-overflow/hex-ovfl.cobra
1 class HexOvfl 2 /# decimal 3 int (same as int32) 4 hex 5 float 6 float32 7 #/ 8 def main is shared 9 i = 0x800000001 # .error. Integer range overflow 10 # 7ffffffff is maxInt -
Tests/820-errors/600-other/150-overflow/float-ovfl.cobra
1 # .skip. 2 # untestable till get exponential notation literals 3 class FloatOvfl 4 /# decimal 5 int (same as int32) 6 hex 7 float 8 #/ 9 def main is shared 10 # max is 1.79769313486232e308 11 f = 1.79769313486233e308 # .error. Float range overflow -
Developer/IntermediateReleaseNotes.text
295 295 * Fixed: Cannot qualify an attribute. ticket:121 296 296 297 297 * Fixed: Cannot read nested classes in binary libraries in some circumstances. ticket:127 298 299 * Fixed: Literals outside Type range give assert error. ticket:131