taskThe Nosica programming language - Tasks: task #986, Literals

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #986: Literals

Submitted by:  David Jobet <djobet>
Submitted on:  Mon 25 Oct 2004 09:06:16 PM UTC  
 
Should Start On: Mon 25 Oct 2004 12:00:00 AM UTCShould be Finished on: Mon 25 Oct 2004 12:00:00 AM UTC
Category: CompilerPriority: 1 - Later
Status: NonePrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenEffort: 0.00

Mon 25 Oct 2004 09:06:16 PM UTC, original submission:

There is currently a dumb compil error in this code :
int8 i = 126; // won't compil

because the method net.nosica.compiler.TypeChecker.TypeCheckVisitor.createLiteral() first checks the value against 0..255 and returns a word8.
The next test is to look the value against -127..128 and returns an int8.
Of course in that case it does not work.

One solution is to returns a special structure which can hold a set of possible types. In that case, it will contain {word8, int8}. Only when doing the lhs assignment would the real type be chosen.

David Jobet <djobet>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by djobet (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup