mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Fix uint properties
This commit is contained in:
parent
3f55aae7de
commit
f2b7d3bd95
6 changed files with 28 additions and 0 deletions
|
@ -377,6 +377,14 @@ class LiteralValue(Value):
|
|||
except:
|
||||
raise CompileError(f"Cannot convert {self.tokens['value']} to integer")
|
||||
|
||||
elif isinstance(type, gir.UIntType):
|
||||
try:
|
||||
int(self.tokens["value"])
|
||||
if int(self.tokens["value"]) < 0:
|
||||
raise Exception()
|
||||
except:
|
||||
raise CompileError(f"Cannot convert {self.tokens['value']} to unsigned integer")
|
||||
|
||||
elif isinstance(type, gir.FloatType):
|
||||
try:
|
||||
float(self.tokens["value"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue