1use jrsonnet_parser::{LocExpr, ParserSettings};2use std::{path::PathBuf, rc::Rc};34thread_local! {5 6 #[allow(unreachable_code)]7 static PARSED_STDLIB: LocExpr = {8 #[cfg(feature = "codegenerated-stdlib")]9 {10 #[allow(clippy::all)]11 return {12 use jrsonnet_parser::*;13 include!(concat!(env!("OUT_DIR"), "/stdlib.rs"))14 };15 }1617 #[cfg(feature = "serialized-stdlib")]18 {19 20 return bincode::deserialize(include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")))21 .unwrap();22 }2324 jrsonnet_parser::parse(25 jrsonnet_stdlib::STDLIB_STR,26 &ParserSettings {27 loc_data: true,28 file_name: Rc::new(PathBuf::from("std.jsonnet")),29 },30 )31 .unwrap()32 }33}3435pub fn get_parsed_stdlib() -> LocExpr {36 PARSED_STDLIB.with(|t| t.clone())37}