Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #21729] IMCC doesn't handle scientific notation constants

6 views
Skip to first unread message

Clinton A. Pierce

unread,
Mar 28, 2003, 11:45:25 AM3/28/03
to bugs-bi...@rt.perl.org
# New Ticket Created by "Clinton A. Pierce"
# Please include the string: [perl #21729]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21729 >


Example:

set I0, 1e20
end

Results in:

(error) line 2: parse error, unexpected IDENTIFIER, expecting '\n'
Didn't create output asm.

A larger example is BASIC's Connect-4 game:

c:> cd parrot\languages\basic\compiler
c:> compile.pl samples\conn4.bas
c:> ..\..\..\languages\imcc\imcc.exe TARG_test.pasm

Results in:

(error) line 4329: parse error, unexpected IDENTIFIER, expecting '\n'
Didn't create output asm.


Joseph F. Ryan

unread,
Mar 28, 2003, 3:43:34 PM3/28/03
to perl6-i...@perl.org


Should it, though? Although it would be pretty convienient, I think
that handling scientific notation would be an unnecessary complication
for IMCC, and it would be better handled by the compilers that target
it. (As in, the compiler converts scientific notation to decimal form
during compilition to IMCC code.)

--
This message was sent using 3wmail.
Your fast free POP3 mail client at www.3wmail.com

Clinton A. Pierce

unread,
Mar 28, 2003, 8:27:36 PM3/28/03
to 3WMail Guest, perl6-i...@perl.org
At 03:43 PM 3/28/2003 -0500, Joseph F. Ryan wrote:
> >Example:
> >
> > set I0, 1e20
> > end
> >
> >Results in:
> >
> > (error) line 2: parse error, unexpected IDENTIFIER, expecting >'\n'
> > Didn't create output asm.
> >
>
>Should it, though? Although it would be pretty convienient, I think
>that handling scientific notation would be an unnecessary complication
>for IMCC, and it would be better handled by the compilers that target
>it. (As in, the compiler converts scientific notation to decimal form
>during compilition to IMCC code.)

Not my call. The current assembler does the Right Thing WRT this notation
and I'd want numeric constants handled somewhere. :)


Mark Biggar

unread,
Mar 29, 2003, 1:25:00 AM3/29/03
to perl6-i...@perl.org

First it's my understanding that the Parrot assembler does support
scientific notation, so IMCC should also. Second we need to handle
BigFloat values and I don't really want to have to express 1e12345
as a 12345+ length char string. On a related note does IMCC have a
token or line length limit?


--
Mark Biggar
ma...@biggar.org
mark.a...@attbi.com


Leopold Toetsch

unread,
Mar 29, 2003, 5:06:50 AM3/29/03
to Mark Biggar, perl6-i...@perl.org
Mark Biggar wrote:

> On a related note does IMCC have a
> token or line length limit?


Not currently, see BUGS. But there ought to be one. There are several
places where e.g. an intermediate string is fixed with size 512 or so.

We need some kind of notation for long string constants, that allow for
reasonable line length limit.

leo


Leopold Toetsch

unread,
Mar 29, 2003, 5:03:03 AM3/29/03
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Clinton A. Pierce (via RT) wrote:

>
> set I0, 1e20


Currently it has to be:

set I0, 1.e20 # dot inside


leo


0 new messages