Added use include

This commit is contained in:
2026-07-08 10:44:09 +02:00
parent bb006c1ba2
commit c564fc3e90
5 changed files with 38 additions and 6 deletions
+5 -1
View File
@@ -262,6 +262,10 @@ include_global = {
"#" ~ "include" ~ "<" ~ identifier ~ ("/" ~ identifier)* ~ ">"
}
include_use_global = {
visibility? ~ "#" ~ "use" ~ static_path ~ semicolon
}
import = {
visibility? ~ "use" ~ static_path ~ semicolon
}
@@ -388,7 +392,7 @@ type_alias = { "type" ~ identifier ~ generics_decl? ~ "=" ~ type_expr ~ ";" }
top_level = {
mod_attribute
| (attributes ~ (include_global | import | impl_for_decl | impl_decl | trait_decl | struct_decl | enum_decl | class_decl | declare_module | function_decl | const_decl | static_decl | type_alias))
| (attributes ~ (include_global | include_use_global | import | impl_for_decl | impl_decl | trait_decl | struct_decl | enum_decl | class_decl | declare_module | function_decl | const_decl | static_decl | type_alias))
}
// ======================================================