()
| 14 | use crate::{Error, WithErrorInfo}; |
| 15 | |
| 16 | fn std() -> &'static decl::Module { |
| 17 | static STD: OnceLock<decl::Module> = OnceLock::new(); |
| 18 | STD.get_or_init(|| { |
| 19 | let _suppressed = debug::log_suppress(); |
| 20 | |
| 21 | let std_lib = crate::SourceTree::new( |
| 22 | [( |
| 23 | PathBuf::from("std.prql"), |
| 24 | include_str!("./std.sql.prql").to_string(), |
| 25 | )], |
| 26 | None, |
| 27 | ); |
| 28 | let ast = crate::parser::parse(&std_lib).unwrap(); |
| 29 | let context = semantic::resolve(ast).unwrap(); |
| 30 | |
| 31 | context.module |
| 32 | }) |
| 33 | } |
| 34 | |
| 35 | pub(super) fn translate_operator_expr(expr: rq::Expr, ctx: &mut Context) -> Result<ExprOrSource> { |
| 36 | let (name, args) = expr.kind.into_operator().unwrap(); |
no test coverage detected