refactor and reorganize code modules

This commit is contained in:
Timur Gordon
2025-03-13 12:39:38 +01:00
parent 634b8c5bad
commit c09e424890
55 changed files with 876 additions and 753 deletions

View File

@@ -0,0 +1,6 @@
@if function.description != ''
// @{function.description}
@endif
pub fn @receiver @{name}(@{params}) @{result} {
@{function.body.trim_space().replace('\t', '')}
}

View File

@@ -0,0 +1,15 @@
// @{iface.description}
@if iface.attrs.len > 0
[
@for attr in iface.attrs
@{attr.name}
@end
]
@end
@{prefix} interface @{name} {
@{fields.join_lines()}
@if mut_fields.len > 0
mut:
@{mut_fields.join_lines()}
@end
}

View File

@@ -0,0 +1,26 @@
@{comments}
@if struct_.attrs.len > 0
[
@for attr in struct_.attrs
@{attr.name}
@end
]
@end
@{prefix}struct @{name} {
@for embed in struct_.embeds
@{embed.get_type_symbol()}
@end
@{priv_fields.join_lines()}
@if pub_fields.len > 0
pub:
@{pub_fields.join_lines()}
@end
@if mut_fields.len > 0
mut:
@{mut_fields.join_lines()}
@end
@if pub_mut_fields.len > 0
pub mut:
@{pub_mut_fields.join_lines()}
@end
}

View File

@@ -0,0 +1,7 @@
Module {
name: '@{mod.name}'
description: '@{mod.description}'
version: '@{mod.version}'
vcs: '@{mod.vcs}'
license: '@{mod.license}'
}