Change package name to verilog filelist parser and remove main.rs

This commit is contained in:
Raamakrishnan 2020-02-02 12:57:35 +05:30
parent f8e5601803
commit 80f5fd6879
5 changed files with 12 additions and 23 deletions

14
Cargo.lock generated
View file

@ -34,13 +34,6 @@ name = "regex-syntax"
version = "0.6.13" version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "sv-filelist-parser"
version = "0.1.0"
dependencies = [
"regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "thread_local" name = "thread_local"
version = "1.0.1" version = "1.0.1"
@ -49,6 +42,13 @@ dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "verilog-filelist-parser"
version = "0.1.0"
dependencies = [
"regex 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata] [metadata]
"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"

View file

@ -1,5 +1,5 @@
[package] [package]
name = "sv-filelist-parser" name = "verilog-filelist-parser"
version = "0.1.0" version = "0.1.0"
authors = ["Raamakrishnan <raamakrishnan1997@gmail.com>"] authors = ["Raamakrishnan <raamakrishnan1997@gmail.com>"]
edition = "2018" edition = "2018"

View file

@ -1,3 +1,3 @@
# sv-filelist-parser # verilog-filelist-parser
A Verilog Filelist parser in Rust A Verilog Filelist parser in Rust

View file

@ -1,11 +0,0 @@
use std::env;
use std::fs;
use std::path::PathBuf;
use sv_filelist_parser;
fn main() {
let args: Vec<String> = env::args().collect();
let filelist = sv_filelist_parser::parse_file(&args[1]).expect("Error parsing");
println!("{:#?}", filelist);
}

View file

@ -1,6 +1,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::path::PathBuf; use std::path::PathBuf;
use sv_filelist_parser; use verilog_filelist_parser;
#[test] #[test]
fn simple_test() { fn simple_test() {
@ -12,7 +12,7 @@ fn simple_test() {
defines.insert("ENV_VAR2".to_string(), Some("var2".to_string())); defines.insert("ENV_VAR2".to_string(), Some("var2".to_string()));
defines.insert("RTL".to_string(), None); defines.insert("RTL".to_string(), None);
let filelist_exp = sv_filelist_parser::Filelist { let filelist_exp = verilog_filelist_parser::Filelist {
files: vec![ files: vec![
PathBuf::from("testcase/file1.sv"), PathBuf::from("testcase/file1.sv"),
PathBuf::from("testcase/file2.sv"), PathBuf::from("testcase/file2.sv"),
@ -29,6 +29,6 @@ fn simple_test() {
std::env::set_var("VAR1", "ENV_VAR1"); std::env::set_var("VAR1", "ENV_VAR1");
std::env::set_var("VAR2", "ENV_VAR2"); std::env::set_var("VAR2", "ENV_VAR2");
let filelist = sv_filelist_parser::parse_file("testcase/files.f").expect("Error parsing"); let filelist = verilog_filelist_parser::parse_file("testcase/files.f").expect("Error parsing");
assert_eq!(filelist_exp, filelist); assert_eq!(filelist_exp, filelist);
} }