Closed nharrand closed 6 years ago
Relates to #156
I think this issue is to this line in the ThingML grammar (here):
terminal INT returns ecore::EInt: ('0'..'9')+;
It seems that the ecore::EInt
type uses int
s in Java. And while that sound fine at first, it is actually a problem - since the integer literal only represents the absolute value of the number (it doesn't include the -
part).
This means that when you write -2147483648
the parser actually tries to parse 2147483648
- which is outside the range of Java int
s.
So - to fix this issue - I think we have to switch to ecore::ELong
, and possibly check that the literal is within range somewhere else (either in a custom TerminalConverter, or in the Checker).
Since I'm not a certified Xtext guru yet - I'll give the responsibility back to the Franck guru
The following code isn't parsed. Meanwhile if
4294967295
is replaced by'4294967295'
, it works.