add noreturn and unreachable
This commit is contained in:
@@ -242,7 +242,7 @@ module.exports = grammar({
|
||||
_type_constant: $ => seq(optional('-'), choice($.integer, $.character)),
|
||||
|
||||
builtin_type: _ => choice(
|
||||
'void', 'type', 'anyopaque', 'bool', 'int', 'uint', 'float', 'range',
|
||||
'void', 'noreturn', 'type', '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',
|
||||
@@ -462,6 +462,7 @@ module.exports = grammar({
|
||||
$.character,
|
||||
$.boolean,
|
||||
$.null,
|
||||
$.unreachable,
|
||||
$.undefined,
|
||||
),
|
||||
|
||||
@@ -645,6 +646,7 @@ module.exports = grammar({
|
||||
|
||||
boolean: _ => choice('true', 'false'),
|
||||
null: _ => 'null',
|
||||
unreachable: _ => 'unreachable',
|
||||
undefined: _ => 'undefined',
|
||||
sink: _ => '_',
|
||||
|
||||
@@ -653,10 +655,10 @@ module.exports = grammar({
|
||||
alias(choice(
|
||||
'test', 'func', 'c_func', 'struct', 'c_struct', 'opaque', 'union', 'enum',
|
||||
'distinct', 'alias', 'import', 'hide', 'return', 'try', 'catch', 'mut',
|
||||
'null', 'undefined', 'orelse', 'and', 'or', 'xor', 'if', 'while', 'for',
|
||||
'null', 'unreachable', 'undefined', 'orelse', 'and', 'or', 'xor', 'if', 'while', 'for',
|
||||
'expand', 'break', 'continue', 'defer', 'errdefer', 'yield', 'match', 'else',
|
||||
'true', 'false',
|
||||
'void', 'type', 'anyopaque', 'bool', 'int', 'uint', 'float', 'range',
|
||||
'void', 'noreturn', 'type', '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',
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
[
|
||||
(null)
|
||||
(unreachable)
|
||||
(undefined)
|
||||
] @constant.builtin
|
||||
|
||||
|
||||
@@ -1577,6 +1577,10 @@
|
||||
"type": "STRING",
|
||||
"value": "void"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "noreturn"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "type"
|
||||
@@ -3215,6 +3219,10 @@
|
||||
"type": "SYMBOL",
|
||||
"name": "null"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "unreachable"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "undefined"
|
||||
@@ -5003,6 +5011,10 @@
|
||||
"type": "STRING",
|
||||
"value": "null"
|
||||
},
|
||||
"unreachable": {
|
||||
"type": "STRING",
|
||||
"value": "unreachable"
|
||||
},
|
||||
"undefined": {
|
||||
"type": "STRING",
|
||||
"value": "undefined"
|
||||
@@ -5094,6 +5106,10 @@
|
||||
"type": "STRING",
|
||||
"value": "null"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "unreachable"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "undefined"
|
||||
@@ -5170,6 +5186,10 @@
|
||||
"type": "STRING",
|
||||
"value": "void"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "noreturn"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "type"
|
||||
|
||||
@@ -882,6 +882,10 @@
|
||||
{
|
||||
"type": "undefined",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "unreachable",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2356,6 +2360,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "unreachable",
|
||||
"named": true,
|
||||
"fields": {}
|
||||
},
|
||||
{
|
||||
"type": "variable_declaration",
|
||||
"named": true,
|
||||
@@ -2924,6 +2933,10 @@
|
||||
"type": "mut",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "noreturn",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "null",
|
||||
"named": false
|
||||
@@ -3004,6 +3017,10 @@
|
||||
"type": "union",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "unreachable",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "usize",
|
||||
"named": false
|
||||
|
||||
+286289
-279201
File diff suppressed because it is too large
Load Diff
@@ -22,3 +22,9 @@ clear func($K, $V type) void {
|
||||
|
||||
Generated :: alias struct_type!(.auto, {"value"}, {i32}, {null})
|
||||
# ^^^^^^^^^^^^ function.builtin
|
||||
|
||||
fail func() noreturn {
|
||||
# ^^^^^^^^ type.builtin
|
||||
unreachable
|
||||
# ^^^^^^^^^^^ constant.builtin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user