Updated type grammar #65

This commit is contained in:
2026-06-05 17:06:06 +02:00
parent 94320bafa6
commit 40b2981252
13 changed files with 5 additions and 823 deletions
+4 -4
View File
@@ -31,6 +31,7 @@ keyword = {
| "dyn"
| "loop"
| "fn"
| "unsafe"
}
identifier = @{
@@ -100,15 +101,15 @@ path_type = {
}
ref_type = {
mutable? ~ lifetime? ~ "*"
"*" ~ lifetime? ~ mutable? ~ type_expr
}
dyn_type = {
"dyn"
"dyn" ~ type_expr
}
type_expr = {
(path_type | tuple_type) ~ (ref_type | dyn_type)*
(path_type | tuple_type | ref_type | dyn_type)
}
lifetime = {
@@ -628,4 +629,3 @@ bin_op = {
expr = { term ~ (bin_op ~ term)* }
term = { prefix* ~ primary ~ postfix* }