mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Remove some more use of SyntaxNode and SyntaxToken
This commit is contained in:
parent
5c795e7bab
commit
cb06394685
3 changed files with 25 additions and 43 deletions
|
@ -320,21 +320,18 @@ pub fn sixtyfps(stream: TokenStream) -> TokenStream {
|
|||
let mut tokens = vec![];
|
||||
fill_token_vec(token_iter, &mut tokens);
|
||||
|
||||
let mut diag = BuildDiagnostics::default();
|
||||
let syntax_node = parser::parse_tokens(tokens.clone(), &mut diag);
|
||||
if diag.has_error() {
|
||||
return diag.report_macro_diagnostic(&tokens);
|
||||
}
|
||||
|
||||
let source_file = if let Some(cargo_manifest) = std::env::var_os("CARGO_MANIFEST_DIR") {
|
||||
let mut path: std::path::PathBuf = cargo_manifest.into();
|
||||
path.push("Cargo.toml");
|
||||
Some(diagnostics::SourceFileInner::from_path_only(path))
|
||||
diagnostics::SourceFileInner::from_path_only(path)
|
||||
} else {
|
||||
None
|
||||
diagnostics::SourceFileInner::from_path_only(Default::default())
|
||||
};
|
||||
|
||||
let syntax_node = parser::SyntaxNodeWithSourceFile { node: syntax_node, source_file };
|
||||
let mut diag = BuildDiagnostics::default();
|
||||
let syntax_node = parser::parse_tokens(tokens.clone(), source_file.into(), &mut diag);
|
||||
if diag.has_error() {
|
||||
return diag.report_macro_diagnostic(&tokens);
|
||||
}
|
||||
|
||||
//println!("{:#?}", syntax_node);
|
||||
let mut compiler_config =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue