Fix README example
This commit is contained in:
parent
09fd5b2d35
commit
ea445625a0
@ -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);
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user