From ca13b39c165ccde0af1eb3bbe53ad20a495b40a8 Mon Sep 17 00:00:00 2001 From: LSTM-Kirigaya <1193466151@qq.com> Date: Tue, 8 Oct 2024 23:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20fast=20include=20=E5=B8=A6?= =?UTF-8?q?=E5=8F=8C=E5=BC=95=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/sv_parser.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/sv_parser.rs b/src/core/sv_parser.rs index 00518cc..57999ef 100644 --- a/src/core/sv_parser.rs +++ b/src/core/sv_parser.rs @@ -605,7 +605,14 @@ fn get_includes(path: &PathBuf) -> Vec { let parts: Vec<&str> = line_content.split_whitespace().collect(); 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(); includes.push(crate::core::hdlparam::Include {