aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-06-29 19:42:17 -0600
committerMelody Horn <melody@boringcactus.com>2021-06-29 19:42:17 -0600
commit2e576c9c0c95dbd5676fb684bd50b1876f738d64 (patch)
treef566b2ad1cc2e8b0af8da75016aa5fd39acaee4c /src
parent79bdc603c7654d0b951dc8938482d9d9c41e98eb (diff)
downloadriir-wxwidgets-2e576c9c0c95dbd5676fb684bd50b1876f738d64.tar.gz
riir-wxwidgets-2e576c9c0c95dbd5676fb684bd50b1876f738d64.zip
friendship ended with clang, janky hand rolled bullshit is my new best friend
Diffstat (limited to 'src')
-rw-r--r--src/main.rs17
-rw-r--r--src/parse.rs6
2 files changed, 11 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs
index ebc9d71..732805c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,9 +1,9 @@
use std::env::{current_dir, set_current_dir};
-use std::fs::{create_dir_all, metadata};
+use std::fs::{create_dir_all, metadata, read_to_string};
use std::path::Path;
use std::process::Command;
-use clang::{Clang, Index};
+mod parse;
const TARGET_TAG: &str = "v3.1.5";
@@ -24,8 +24,6 @@ fn main() {
"--quiet",
"https://github.com/wxWidgets/wxWidgets.git",
"orig",
- "--depth",
- "1",
])
.status()
.unwrap();
@@ -66,12 +64,7 @@ fn main() {
assert!(cargo_new.success());
}
- let clang = Clang::new().unwrap();
- let index = Index::new(&clang, true, true);
-
- let mut root_header_parser = index.parser("orig/include/wx/wx.h");
- root_header_parser.keep_going(true);
- root_header_parser.arguments(&["-Iorig/include", "-D"]);
- let root_header = root_header_parser.parse().unwrap();
- println!("{}", root_header.get_entity().get_pretty_printer().print());
+ let wx_h_text = read_to_string("orig/include/wx/wx.h").unwrap();
+ let lib_root_h = parse::parse(&wx_h_text);
+ dbg!(lib_root_h);
}
diff --git a/src/parse.rs b/src/parse.rs
new file mode 100644
index 0000000..e528f01
--- /dev/null
+++ b/src/parse.rs
@@ -0,0 +1,6 @@
+#[derive(Debug)]
+pub struct FileItem;
+
+pub fn parse(file: &str) -> Vec<FileItem> {
+ todo!()
+}