tree-sitter-objectscript-routine 2.0.0

ObjectScript routine grammar for tree-sitter
Documentation
use std::path::Path;

fn main() {
    let root_dir = Path::new(".");
    let routine_dir = root_dir.join("objectscript_routine").join("src");
    let common_dir = root_dir.join("common");
    let mut config = cc::Build::new();

    config.include(&routine_dir);

    for path in &[
        routine_dir.join("parser.c"),
        routine_dir.join("scanner.c"),
    ] {
        config.file(path);
        println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
    }

    for header in &["scanner.h", "expr-scanner.h"] {
        println!(
            "cargo:rerun-if-changed={}",
            common_dir.join(header).to_str().unwrap()
        );
    }

    // MSVC quirk
    if cfg!(target_env = "msvc") {
        config.define("TREE_SITTER_DISABLE_ATOMIC", None);
    }

    config.compile("tree-sitter-objectscript-routine");
}