Forums

var names: bug or not?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

var names: bug or not?

Postby relez » Thu Nov 06, 2008 5:30 pm

this is trivial but....
i cannot define vars with name int1 or int001... example:

Code: Select all
class Test
   def main is shared
      int01 as int
      intb as int


intb is ok but compiler refuses int01 and also int001, or int0007 etc.... and complains:
Unsupported integer size.....
If this is by design i think that we might need a different compiler message, such as "incorrect var name...." or similar.
relez
 
Posts: 69

Re: var names: bug or not?

Postby Charles » Thu Nov 06, 2008 5:56 pm

Interesting. Cobra has types:

-- int8, int16, int32, int64
-- uint8, uint16, uint32, uint64

The tokenizer picks up on any int<NN> and reports it as an integer type of size NN. The parser then complains if the size is not in {8, 16, 32, 64}. This will remain since it would be confusing to have an int8 type and an int4 var name. I have updated the error message in the parser to read:

error: Unsupported integer size: 1. Try int8, int16, int32 or int64. Or, for non-types, use a name different than the form "intNN" which is reserved for integer types.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: var names: bug or not?

Postby relez » Thu Nov 06, 2008 6:02 pm

Ok, thk u ;)
relez
 
Posts: 69


Return to Discussion

Who is online

Users browsing this forum: No registered users and 34 guests