Include parser header content in library crate

This commit is contained in:
Max Brunsfeld 2019-02-05 11:59:34 -08:00
parent 6194dfc247
commit d7bc61cada
2 changed files with 3 additions and 1 deletions

View file

@ -53,7 +53,7 @@ pub fn generate_parser_in_directory(
npm_files::index_js(&language_name)
})?;
ensure_file(&repo_header_path.join("parser.h"), || {
include_str!("../../../lib/include/tree_sitter/parser.h")
tree_sitter::PARSER_HEADER
})?;
Ok(())
}

View file

@ -21,6 +21,8 @@ use std::slice;
use std::str;
use std::u16;
pub const PARSER_HEADER: &'static str = include_str!("../include/tree_sitter/parser.h");
#[derive(Clone, Copy)]
#[repr(transparent)]
pub struct Language(*const ffi::TSLanguage);