better namespaces
This commit is contained in:
+8
-12
@@ -307,23 +307,19 @@ pub fn transpile(input: String, indent: u32, state: LexerState, options: &mut Op
|
|||||||
)
|
)
|
||||||
.as_str();
|
.as_str();
|
||||||
} else if ast.ast_type == AstType::Namespace {
|
} else if ast.ast_type == AstType::Namespace {
|
||||||
let l_opt = options.auto_pub;
|
result += format!(
|
||||||
options.auto_pub = true;
|
"mod {} {}{}{}",
|
||||||
let transpiled_code = transpile(
|
&ast.tokens[0].value.clone(),
|
||||||
|
"{",
|
||||||
|
transpile(
|
||||||
ast.tokens[1].value.clone(),
|
ast.tokens[1].value.clone(),
|
||||||
0,
|
0,
|
||||||
LexerState { line: 1, column: 0 },
|
LexerState { line: 1, column: 0 },
|
||||||
options,
|
options,
|
||||||
);
|
),
|
||||||
options.auto_pub = l_opt;
|
"}"
|
||||||
fs::write(
|
|
||||||
("wyst_tmp/".to_string() + &ast.tokens[0].value.clone()) + ".rs",
|
|
||||||
transpiled_code,
|
|
||||||
)
|
)
|
||||||
.expect("Error writing file");
|
.as_str();
|
||||||
result += "mod ";
|
|
||||||
result += &ast.tokens[0].value.clone();
|
|
||||||
result += ";\n";
|
|
||||||
}
|
}
|
||||||
// flp
|
// flp
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user