Ticket #131 (closed defect: fixed)
Fractional literals outside Decimal/float type range give assert error
Reported by: | hopscc | Owned by: | Chuck |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Cobra Compiler | Version: | 0.8.0 |
Keywords: | Cc: |
Description
If specify a Decimal literal outside of the range for its type or do the same for float32 get a really horrible assert error and stack trace rather than an error diagnostic
# literal > Max_Decimal b = 80_228_162_514_264_337_593_543_950_335.1
gives
Unhandled Exception: Cobra.Lang_ert_635e27de755dde73ac9b558e38a46201.AssertException: sourceSite = C:\home\hops\src\cobra\wkspace\Source\CobraTokenizer.cobra:505 in CobraTokenizer.onFRACTIONAL_LIT for object CobraTokenizer(_sourceLineIndex=56, _lineNum=9, _colNum=57, _charNum=322, _indentCount=2, _substLBracketCount=0, _inSubstStringSingle=false, _inSubstStringDouble=false, _inDocString=false_inCommentBlock=0) info = 'TODO: FRACTIONAL_LIT Overflow' this = CobraTokenizer(_sourceLineIndex=56, _lineNum=9, _colNum=57, _charNum=322, _indentCount=2, _substLBracketCount=0, _inSubstStringSingle=false, _inSubstStringDouble=false, _inDocString=false_inCommentBlock=0) at Tokenizer._tokenPostProcess(MethodInfo meth, IToken tok) in c:\home\hops\src\cobra\wkspace\Source\Tokenizer.cobra:line 728 at Tokenizer.get__nextToken() in c:\home\hops\src\cobra\wkspace\Source\Tokenizer.cobra:line 649 at CobraTokenizer.get__nextToken() in c:\home\hops\src\cobra\wkspace\Source\CobraTokenizer.cobra:line 273 at Tokenizer.get__nextToken() in c:\home\hops\src\cobra\wkspace\Source\Tokenizer.cobra:line 662 at CobraTokenizer.get__nextToken() in c:\home\hops\src\cobra\wkspace\Source\CobraTokenizer.cobra:line 273 at Tokenizer.get_NextToken() in c:\home\hops\src\cobra\wkspace\Source\Tokenizer.cobra:line 445 at Tokenizer.AllTokens() in c:\home\hops\src\cobra\wkspace\Source\Tokenizer.cobra:line 461 at Parser._preParseSource(String fileName, String source) in c:\home\hops\src\cobra\wkspace\Source\CobraParser.cobra:line 225 at Parser.ParseSource(String fileName, String source) in c:\home\hops\src\cobra\wkspace\Source\CobraParser.cobra:line 191 at Parser.ParseFileNamed(String fileName) in c:\home\hops\src\cobra\wkspace\Source\CobraParser.cobra:line 179 at Compiler.ParseFilesNamed(IList`1 filenames) in c:\home\hops\src\cobra\wkspace\Source\Compiler.cobra:line 439 at Compiler._compileFilesNamed(IList`1 paths, Boolean writeTestInvocation, Boolean stopAfterBindInt) in c:\home\hops\src\cobra\wkspace\Source\Compiler.cobra:line 297 at Compiler.CompileFilesNamed(IList`1 paths, Boolean writeTestInvocation, Boolean stopAfterBindInt) in c:\home\hops\src\cobra\wkspace\Source\Compiler.cobra:line 264 at CommandLine.DoCompile(List`1 paths, Boolean willPrintSuccessMsg, Boolean writeTestInvocation, Boolean stopAfterBindInt) in c:\home\hops\src\cobra\wkspace\Source\CommandLine.cobra:line 570 at CommandLine.DoRun(List`1 paths) in c:\home\hops\src\cobra\wkspace\Source\CommandLine.cobra:line 646 at CommandLine.Run(List`1 args) in c:\home\hops\src\cobra\wkspace\Source\CommandLine.cobra:line 543 at CommandLine.Run() in c:\home\hops\src\cobra\wkspace\Source\CommandLine.cobra:line 485 at CobraMain.Main() in c:\home\hops\src\cobra\wkspace\Source\cobra.cobra:line 13 (null)
The 'TODO' clauses in caught overflow exceptions around decimal,float.parse need implementing in CobraTokeniser.cobra
Attachments
Change History
Note: See
TracTickets for help on using
tickets.