Parse lines starting with # as comments

This commit is contained in:
Aadi Desai 2022-05-12 15:53:18 +00:00 committed by GitHub
parent 8fbcfb64d8
commit 6906c4fa60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -34,7 +34,7 @@ pub fn parse_line(line: &str) -> LineType {
let incdirs = line.trim_start_matches("+incdir+").trim_end_matches('+'); let incdirs = line.trim_start_matches("+incdir+").trim_end_matches('+');
let incdir_vec: Vec<&str> = incdirs.split('+').collect(); let incdir_vec: Vec<&str> = incdirs.split('+').collect();
LineType::IncDir(incdir_vec) LineType::IncDir(incdir_vec)
} else if line.starts_with("//") { } else if line.starts_with("//") || line.starts_with("#") {
LineType::Comment LineType::Comment
} else if line.starts_with('-') || line.starts_with('+') { } else if line.starts_with('-') || line.starts_with('+') {
LineType::Unknown LineType::Unknown

View file

@ -3,6 +3,7 @@ testcase/file2.sv
testcase/file3.sv testcase/file3.sv
+incdir+testcase/ +incdir+testcase/
// Some comment // Some comment
# Another comment
+define+a=b+c=d+e=f +define+a=b+c=d+e=f
+define+$(VAR1)=var1 +define+$(VAR1)=var1
+define+${VAR2}=var2 +define+${VAR2}=var2