修复 fast include 带双引号的问题

This commit is contained in:
锦恢 2024-10-08 23:51:44 +08:00
parent 58ef3cafc8
commit ca13b39c16

View File

@ -605,7 +605,14 @@ fn get_includes(path: &PathBuf) -> Vec<crate::core::hdlparam::Include> {
let parts: Vec<&str> = line_content.split_whitespace().collect(); let parts: Vec<&str> = line_content.split_whitespace().collect();
if parts.len() >= 2 { if parts.len() >= 2 {
let path = parts[1]; let mut path = parts[1].trim();
if path.starts_with("\"") {
path = path.strip_prefix("\"").unwrap();
}
if path.ends_with("\"") {
path = path.strip_suffix("\"").unwrap();
}
let last_character = line_content.find(path).unwrap() + path.len(); let last_character = line_content.find(path).unwrap() + path.len();
includes.push(crate::core::hdlparam::Include { includes.push(crate::core::hdlparam::Include {