Adding some code but likely need to create a build script

This commit is contained in:
Joseph Ferano 2022-12-22 00:37:44 +07:00
parent 5c11808e7d
commit 5ba313c568
3 changed files with 15 additions and 4 deletions

View File

@ -1,7 +1,9 @@
mod app;
mod ui;
mod input;
mod treesitter;
pub use app::*;
pub use ui::draw;
pub use input::handle_input;
pub use treesitter::compile_md_grammar;

13
src/treesitter.rs Normal file
View File

@ -0,0 +1,13 @@
use tree_sitter::{Parser, Language};
use std::path::PathBuf;
pub fn compile_md_grammar() {
let dir: PathBuf = ["tree-sitter-javascript", "src"].iter().collect();
cc::Build::new()
.include(&dir)
.file(dir.join("parser.c"))
.file(dir.join("scanner.c"))
.compile("tree-sitter-javascript")
}

View File

@ -1,4 +0,0 @@
use tree_sitter::{Parser, Language};