lib-ruby-parser-bindings 0.13.0

Tools to generate bindings for lib-ruby-parser
use crate::{options, NS as GLOBAL_NS};

fn ns() -> String {
    format!("{}__magic_comment", GLOBAL_NS)
}

pub fn magic_comment() -> String {
    format!(
        "
// MagicComment
{magic_comment_blob} {fn_attributes} {ns}__new(
    {magic_comment_kind_blob} kind_blob,
    {loc_blob} key_l_blob,
    {loc_blob} value_l_blob);
void {fn_attributes} {ns}__drop({magic_comment_blob} *self_blob);
const {magic_comment_kind_blob} *{fn_attributes} {ns}__get_kind(const {magic_comment_blob} *self_blob);
const {loc_blob} *{fn_attributes} {ns}__get_key_l(const {magic_comment_blob} *self_blob);
const {loc_blob} *{fn_attributes} {ns}__get_value_l(const {magic_comment_blob} *self_blob);
",
        ns = ns(),
        fn_attributes = options().fn_attributes,
        magic_comment_blob = options().magic_comment_blob_name,
        magic_comment_kind_blob = options().magic_comment_kind_blob_name,
        loc_blob = options().loc_blob_name,
    )
}