This commit is contained in:
dalance 2020-04-01 15:35:06 +09:00
commit 69cc26c5e4

View File

@ -48,7 +48,7 @@ fn main() {
let includes: Vec<PathBuf> = Vec::new(); let includes: Vec<PathBuf> = Vec::new();
// Parse // Parse
let result = parse_sv(&path, &defines, &includes); let result = parse_sv(&path, &defines, &includes, false);
if let Ok((syntax_tree, _)) = result { if let Ok((syntax_tree, _)) = result {
// &SyntaxTree is iterable // &SyntaxTree is iterable
@ -62,13 +62,13 @@ fn main() {
let id = get_identifier(id).unwrap(); let id = get_identifier(id).unwrap();
// Original string can be got by SyntaxTree::get_str(self, locate: &Locate) // Original string can be got by SyntaxTree::get_str(self, locate: &Locate)
let id = syntax_tree.get_str(&id); let id = syntax_tree.get_str(&id).unwrap();
println!("module: {}", id); println!("module: {}", id);
} }
RefNode::ModuleDeclarationAnsi(x) => { RefNode::ModuleDeclarationAnsi(x) => {
let id = unwrap_node!(x, ModuleIdentifier).unwrap(); let id = unwrap_node!(x, ModuleIdentifier).unwrap();
let id = get_identifier(id).unwrap(); let id = get_identifier(id).unwrap();
let id = syntax_tree.get_str(&id); let id = syntax_tree.get_str(&id).unwrap();
println!("module: {}", id); println!("module: {}", id);
} }
_ => (), _ => (),