unsigned integer constraint (uint)
This commit is contained in:
@@ -228,7 +228,7 @@ module.exports = grammar({
|
||||
_type_constant: $ => seq(optional('-'), choice($.integer, $.character)),
|
||||
|
||||
builtin_type: _ => choice(
|
||||
'void', 'anyopaque', 'bool', 'int', 'float', 'range',
|
||||
'void', 'anyopaque', 'bool', 'int', 'uint', 'float', 'range',
|
||||
'i8', 'i16', 'i32', 'i64', 'u8', 'u16', 'u32', 'u64',
|
||||
'isize', 'usize', 'f32', 'f64',
|
||||
'c_char', 'c_schar', 'c_uchar', 'c_short', 'c_ushort',
|
||||
|
||||
@@ -1476,6 +1476,10 @@
|
||||
"type": "STRING",
|
||||
"value": "int"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "uint"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "float"
|
||||
|
||||
@@ -2815,6 +2815,10 @@
|
||||
"type": "u8",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "uint",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "undefined",
|
||||
"named": true
|
||||
|
||||
+4262
-2805
File diff suppressed because it is too large
Load Diff
@@ -493,3 +493,19 @@ visit func(kind Kind, value Value) void {
|
||||
(sink))
|
||||
(expression
|
||||
(identifier))))))))))))
|
||||
|
||||
==================
|
||||
Unsigned constraint
|
||||
==================
|
||||
|
||||
value uint :: 255
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(global_constant_declaration
|
||||
(identifier)
|
||||
(type
|
||||
(builtin_type))
|
||||
(expression
|
||||
(integer))))
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
hide helper func() void {}
|
||||
# <- keyword
|
||||
|
||||
value uint :: 1
|
||||
# ^^^^ type.builtin
|
||||
|
||||
main func() void {
|
||||
_ = sizeof!(i32)
|
||||
# ^^^^^^ function.builtin
|
||||
|
||||
Reference in New Issue
Block a user