difftreelog
perf reimplement AST codegen
in: master
10 files changed
Cargo.lockdiffbeforeafterboth275 "jrsonnet-gcmodule",275 "jrsonnet-gcmodule",276 "rustc-hash",276 "rustc-hash",277 "serde",277 "serde",278 "structdump",278]279]279280280[[package]]281[[package]]292dependencies = [293dependencies = [293 "jrsonnet-gcmodule",294 "jrsonnet-gcmodule",294 "jrsonnet-interner",295 "jrsonnet-interner",295 "jrsonnet-stdlib",296 "peg",296 "peg",297 "serde",297 "serde",298 "static_assertions",298 "static_assertions",299 "structdump",299]300]300301301[[package]]302[[package]]312 "serde",313 "serde",313 "serde_json",314 "serde_json",314 "serde_yaml_with_quirks",315 "serde_yaml_with_quirks",316 "structdump",315]317]316318317[[package]]319[[package]]575source = "registry+https://github.com/rust-lang/crates.io-index"577source = "registry+https://github.com/rust-lang/crates.io-index"576checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"578checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"579580[[package]]581name = "structdump"582version = "0.2.0"583source = "registry+https://github.com/rust-lang/crates.io-index"584checksum = "b0570327507bf281d8a6e6b0d4c082b12cb6bcee27efce755aa5efacd44076c1"585dependencies = [586 "proc-macro2",587 "quote",588 "structdump-derive",589]590591[[package]]592name = "structdump-derive"593version = "0.2.0"594source = "registry+https://github.com/rust-lang/crates.io-index"595checksum = "29cc0b59cfa11f1bceda09a9a7e37e6a6c3138575fd24ade8aa9af6d09aedf28"596dependencies = [597 "proc-macro2",598 "quote",599 "syn",600]577601578[[package]]602[[package]]579name = "syn"603name = "syn"Cargo.tomldiffbeforeafterboth8opt-level = 38opt-level = 39lto = "fat"9lto = "fat"10codegen-units = 110codegen-units = 111debug = 011# debug = 012panic = "abort"12panic = "abort"13strip = true13# strip = true1414crates/jrsonnet-interner/Cargo.tomldiffbeforeafterboth7edition = "2021"7edition = "2021"889[features]9[features]10default = ["serde"]10default = []11# Implement value serialization using structdump12structdump = ["dep:structdump"]13# Implement value serialization using serde14#15# Warning: serialized values won't be deduplicated11serde = ["dep:serde"]16serde = ["dep:serde"]121713[dependencies]18[dependencies]14jrsonnet-gcmodule = { version = "0.3.4" }19jrsonnet-gcmodule = { version = "0.3.4" }152016serde = { version = "1.0", optional = true }21serde = { version = "1.0", optional = true }22structdump = { version = "0.2.0", optional = true }2317rustc-hash = "1.1"24rustc-hash = "1.1"18hashbrown = { version = "0.12.1", features = ["inline-more"] }25hashbrown = { version = "0.12.1", features = ["inline-more"] }crates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth205 }205 }206}206}207207208#[cfg(feature = "serde")]208impl serde::Serialize for IStr {209impl serde::Serialize for IStr {209 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>210 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>210 where211 where214 }215 }215}216}216217218#[cfg(feature = "serde")]217impl<'de> serde::Deserialize<'de> for IStr {219impl<'de> serde::Deserialize<'de> for IStr {218 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>220 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>219 where221 where224 }226 }225}227}228229#[cfg(feature = "structdump")]230impl structdump::Codegen for IStr {231 fn gen_code(232 &self,233 res: &mut structdump::CodegenResult,234 _unique: bool,235 ) -> structdump::TokenStream {236 let s: &str = self;237 res.add_code(238 structdump::quote! {239 structdump_import::IStr::from(#s)240 },241 Some(structdump::quote![structdump_import::IStr]),242 false,243 )244 }245}226246227thread_local! {247thread_local! {228 static POOL: RefCell<HashMap<Inner, (), BuildHasherDefault<FxHasher>>> = RefCell::new(HashMap::with_capacity_and_hasher(200, BuildHasherDefault::default()));248 static POOL: RefCell<HashMap<Inner, (), BuildHasherDefault<FxHasher>>> = RefCell::new(HashMap::with_capacity_and_hasher(200, BuildHasherDefault::default()));crates/jrsonnet-parser/Cargo.tomldiffbeforeafterboth7edition = "2021"7edition = "2021"889[features]9[features]10default = []10exp-destruct = []11exp-destruct = []12# Implement serialization of AST using structdump13#14# Structdump generates code, which exactly replicated passed AST15# Contrary to serde, has no code bloat problem, and is recommended16#17# The only limitation is serialized form is only useable if built from build script18structdump = ["dep:structdump", "jrsonnet-interner/structdump"]19# Implement serialization of AST using serde20#21# Warning: as serde doesn't deduplicate strings, `Source` struct will bloat22# output binary with repeating source code. To resolve this issue, you should either23# override serialization of this struct using custom `Serializer`/`Deserializer`,24# not rely on Source, and fill its `source_code` with empty value, or use `structdump`25# instead26serde = ["dep:serde"]112712[dependencies]28[dependencies]13jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }29jrsonnet-interner = { path = "../jrsonnet-interner", version = "0.4.2" }193520serde = { version = "1.0", features = ["derive", "rc"], optional = true }36serde = { version = "1.0", features = ["derive", "rc"], optional = true }2122[dev-dependencies]23jrsonnet-stdlib = { path = "../jrsonnet-stdlib", version = "0.4.2" }37structdump = { version = "0.2.0", features = ["derive"], optional = true }2438crates/jrsonnet-parser/src/expr.rsdiffbeforeafterboth8use jrsonnet_interner::IStr;8use jrsonnet_interner::IStr;9#[cfg(feature = "serde")]9#[cfg(feature = "serde")]10use serde::{Deserialize, Serialize};10use serde::{Deserialize, Serialize};11#[cfg(feature = "structdump")]12use structdump::Codegen;111312use crate::source::Source;14use crate::source::Source;131514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]16#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]17#[cfg_attr(feature = "structdump", derive(Codegen))]15#[derive(Debug, PartialEq, Trace)]18#[derive(Debug, PartialEq, Trace)]16pub enum FieldName {19pub enum FieldName {17 /// {fixed: 2}20 /// {fixed: 2}20 Dyn(LocExpr),23 Dyn(LocExpr),21}24}222526#[cfg_attr(feature = "structdump", derive(Codegen))]23#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]27#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]24#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]28#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]25pub enum Visibility {29pub enum Visibility {37 }41 }38}42}394344#[cfg_attr(feature = "structdump", derive(Codegen))]40#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]45#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]41#[derive(Clone, Debug, PartialEq, Trace)]46#[derive(Clone, Debug, PartialEq, Trace)]42pub struct AssertStmt(pub LocExpr, pub Option<LocExpr>);47pub struct AssertStmt(pub LocExpr, pub Option<LocExpr>);434849#[cfg_attr(feature = "structdump", derive(Codegen))]44#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]50#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]45#[derive(Debug, PartialEq, Trace)]51#[derive(Debug, PartialEq, Trace)]46pub struct FieldMember {52pub struct FieldMember {51 pub value: LocExpr,57 pub value: LocExpr,52}58}535960#[cfg_attr(feature = "structdump", derive(Codegen))]54#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]61#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]55#[derive(Debug, PartialEq, Trace)]62#[derive(Debug, PartialEq, Trace)]56pub enum Member {63pub enum Member {59 AssertStmt(AssertStmt),66 AssertStmt(AssertStmt),60}67}616869#[cfg_attr(feature = "structdump", derive(Codegen))]62#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]70#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]63#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]71#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]64pub enum UnaryOpType {72pub enum UnaryOpType {84 }92 }85}93}869495#[cfg_attr(feature = "structdump", derive(Codegen))]87#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]96#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]88#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]97#[derive(Debug, Clone, Copy, PartialEq, Eq, Trace)]89pub enum BinaryOpType {98pub enum BinaryOpType {150}159}151160152/// name, default value161/// name, default value162#[cfg_attr(feature = "structdump", derive(Codegen))]153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]163#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]154#[derive(Debug, PartialEq, Trace)]164#[derive(Debug, PartialEq, Trace)]155pub struct Param(pub Destruct, pub Option<LocExpr>);165pub struct Param(pub Destruct, pub Option<LocExpr>);156166157/// Defined function parameters167/// Defined function parameters168#[cfg_attr(feature = "structdump", derive(Codegen))]158#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]159#[derive(Debug, Clone, PartialEq, Trace)]170#[derive(Debug, Clone, PartialEq, Trace)]160pub struct ParamsDesc(pub Rc<Vec<Param>>);171pub struct ParamsDesc(pub Rc<Vec<Param>>);166 }177 }167}178}168179180#[cfg_attr(feature = "structdump", derive(Codegen))]169#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]170#[derive(Debug, PartialEq, Trace)]182#[derive(Debug, PartialEq, Trace)]171pub struct ArgsDesc {183pub struct ArgsDesc {187 Drop,199 Drop,188}200}189201202#[cfg_attr(feature = "structdump", derive(Codegen))]190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]191#[derive(Debug, Clone, PartialEq, Trace)]204#[derive(Debug, Clone, PartialEq, Trace)]192pub enum Destruct {205pub enum Destruct {216 }229 }217}230}218231232#[cfg_attr(feature = "structdump", derive(Codegen))]219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]220#[derive(Debug, Clone, PartialEq, Trace)]234#[derive(Debug, Clone, PartialEq, Trace)]221pub enum BindSpec {235pub enum BindSpec {230 },244 },231}245}232246247#[cfg_attr(feature = "structdump", derive(Codegen))]233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]234#[derive(Debug, PartialEq, Trace)]249#[derive(Debug, PartialEq, Trace)]235pub struct IfSpecData(pub LocExpr);250pub struct IfSpecData(pub LocExpr);236251252#[cfg_attr(feature = "structdump", derive(Codegen))]237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]238#[derive(Debug, PartialEq, Trace)]254#[derive(Debug, PartialEq, Trace)]239pub struct ForSpecData(pub IStr, pub LocExpr);255pub struct ForSpecData(pub IStr, pub LocExpr);240256257#[cfg_attr(feature = "structdump", derive(Codegen))]241#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]242#[derive(Debug, PartialEq, Trace)]259#[derive(Debug, PartialEq, Trace)]243pub enum CompSpec {260pub enum CompSpec {244 IfSpec(IfSpecData),261 IfSpec(IfSpecData),245 ForSpec(ForSpecData),262 ForSpec(ForSpecData),246}263}247264265#[cfg_attr(feature = "structdump", derive(Codegen))]248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]249#[derive(Debug, PartialEq, Trace)]267#[derive(Debug, PartialEq, Trace)]250pub struct ObjComp {268pub struct ObjComp {256 pub compspecs: Vec<CompSpec>,274 pub compspecs: Vec<CompSpec>,257}275}258276277#[cfg_attr(feature = "structdump", derive(Codegen))]259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]278#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]260#[derive(Debug, PartialEq, Trace)]279#[derive(Debug, PartialEq, Trace)]261pub enum ObjBody {280pub enum ObjBody {262 MemberList(Vec<Member>),281 MemberList(Vec<Member>),263 ObjComp(ObjComp),282 ObjComp(ObjComp),264}283}265284285#[cfg_attr(feature = "structdump", derive(Codegen))]266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]267#[derive(Debug, PartialEq, Eq, Clone, Copy, Trace)]287#[derive(Debug, PartialEq, Eq, Clone, Copy, Trace)]268pub enum LiteralType {288pub enum LiteralType {274 False,294 False,275}295}276296297#[cfg_attr(feature = "structdump", derive(Codegen))]277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]278#[derive(Debug, PartialEq, Trace)]299#[derive(Debug, PartialEq, Trace)]279pub struct SliceDesc {300pub struct SliceDesc {283}304}284305285/// Syntax base306/// Syntax base307#[cfg_attr(feature = "structdump", derive(Codegen))]286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]287#[derive(Debug, PartialEq, Trace)]309#[derive(Debug, PartialEq, Trace)]288pub enum Expr {310pub enum Expr {351}373}352374353/// file, begin offset, end offset375/// file, begin offset, end offset376#[cfg_attr(feature = "structdump", derive(Codegen))]354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]377#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]355#[derive(Clone, PartialEq, Eq, Trace)]378#[derive(Clone, PartialEq, Eq, Trace)]356#[trace(skip)]379#[trace(skip)]373396374/// Holds AST expression and its location in source file397/// Holds AST expression and its location in source file375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]398#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]399#[cfg_attr(feature = "structdump", derive(Codegen))]376#[derive(Clone, PartialEq, Trace)]400#[derive(Clone, PartialEq, Trace)]377pub struct LocExpr(pub Rc<Expr>, pub ExprLocation);401pub struct LocExpr(pub Rc<Expr>, pub ExprLocation);378402crates/jrsonnet-parser/src/source.rsdiffbeforeafterboth9use jrsonnet_interner::IStr;9use jrsonnet_interner::IStr;10#[cfg(feature = "serde")]10#[cfg(feature = "serde")]11use serde::{Deserialize, Serialize};11use serde::{Deserialize, Serialize};12#[cfg(feature = "structdump")]13use structdump::Codegen;121413use crate::location::{location_to_offset, offset_to_location, CodeLocation};15use crate::location::{location_to_offset, offset_to_location, CodeLocation};141617#[cfg_attr(feature = "structdump", derive(Codegen))]15#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]18#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]16#[derive(PartialEq, Eq, Debug, Hash, Clone)]19#[derive(PartialEq, Eq, Debug, Hash, Clone)]17pub enum SourcePath {20pub enum SourcePath {394240/// Either real file, or virtual43/// Either real file, or virtual41/// Hash of FileName always have same value as raw Path, to make it possible to use with raw_entry_mut44/// Hash of FileName always have same value as raw Path, to make it possible to use with raw_entry_mut45#[cfg_attr(feature = "structdump", derive(Codegen))]42#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]46#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]43#[derive(Clone, PartialEq, Eq, Debug)]47#[derive(Clone, PartialEq, Eq, Debug)]44pub struct Source(Rc<(SourcePath, IStr)>);48pub struct Source(pub Rc<(SourcePath, IStr)>);45static_assertions::assert_eq_size!(Source, *const ());49static_assertions::assert_eq_size!(Source, *const ());465047impl Trace for Source {51impl Trace for Source {crates/jrsonnet-stdlib/Cargo.tomldiffbeforeafterboth7edition = "2021"7edition = "2021"889[features]9[features]10default = []10default = ["codegenerated-stdlib"]11# Serializes standard library AST, and deserialize on start, instead of parsing it every run from text11# Speed-up initialization by generating code for parsed stdlib, instead12# of invoking parser for it12serialized-stdlib = ["bincode", "jrsonnet-parser/serde"]13codegenerated-stdlib = ["jrsonnet-parser/structdump"]13# Enables legacy `std.thisFile` support, at the cost of worse caching14# Enables legacy `std.thisFile` support, at the cost of worse caching14legacy-this-file = []15legacy-this-file = []15# Add order preservation flag to some functions16# Add order preservation flag to some functions45serde_yaml_with_quirks = "0.8.24"46serde_yaml_with_quirks = "0.8.24"464747[build-dependencies]48[build-dependencies]48jrsonnet-parser = { path = "../jrsonnet-parser", version = "0.4.2", features = [49jrsonnet-parser = { path = "../jrsonnet-parser", version = "0.4.2" }49 "serde",50] }51serde = "1.0"50structdump = { version = "0.2.0", features = ["derive"] }52bincode = "1.3"5351crates/jrsonnet-stdlib/build.rsdiffbeforeafterboth1use std::{borrow::Cow, env, fs::File, io::Write, path::Path};1use std::{borrow::Cow, env, fs::File, io::Write, path::Path};223use bincode::serialize;4use jrsonnet_parser::{parse, ParserSettings, Source};3use jrsonnet_parser::{parse, ParserSettings, Source};4use structdump::CodegenResult;556fn main() {6fn main() {7 let parsed = parse(7 let parsed = parse(15 )15 )16 .expect("parse");16 .expect("parse");1718 let mut out = CodegenResult::default();1920 let v = out.codegen(&parsed, true);172118 {22 {19 let out_dir = env::var("OUT_DIR").unwrap();23 let out_dir = env::var("OUT_DIR").unwrap();20 let dest_path = Path::new(&out_dir).join("stdlib.bincode");24 let dest_path = Path::new(&out_dir).join("stdlib.rs");21 let mut f = File::create(&dest_path).unwrap();25 let mut f = File::create(&dest_path).unwrap();22 f.write_all(&serialize(&parsed).unwrap()).unwrap();26 f.write_all(v.to_string().replace(';', ";\n").as_bytes())27 .unwrap();23 }28 }24}29}crates/jrsonnet-stdlib/src/expr.rsdiffbeforeafterboth1use jrsonnet_parser::LocExpr;23mod structdump_import {1use std::borrow::Cow;4 pub(super) use std::{borrow::Cow, rc::Rc};253use jrsonnet_parser::{LocExpr, ParserSettings, Source};6 pub(super) use jrsonnet_parser::*;45pub const STDLIB_STR: &str = include_str!("./std.jsonnet");7 pub(super) use vec;8 pub(super) use Option;9}6107pub fn stdlib_expr() -> LocExpr {11pub fn stdlib_expr() -> LocExpr {8 #[cfg(feature = "serialized-stdlib")]12 #[cfg(feature = "serialized-stdlib")]9 {13 {10 // Should not panic, stdlib.bincode is generated in build.rs14 use bincode::{BincodeRead, DefaultOptions, Options};15 use serde::{Deserialize, Deserializer};1617 struct LocDeserializer<R, O: Options> {18 source: Source,19 wrapped: bincode::Deserializer<R, O>,20 }21 macro_rules! delegate {22 ($(fn $name:ident($($arg:ident: $ty:ty),*))+) => {$(23 fn $name<V>(mut self $(, $arg: $ty)*, visitor: V) -> Result<V::Value, Self::Error>24 where V: serde::de::Visitor<'de>,25 {26 self.wrapped.$name($($arg,)* visitor)27 }28 )+};29 }30 impl<'de, R, O> Deserializer<'de> for LocDeserializer<R, O>31 where32 R: BincodeRead<'de>,33 O: Options,34 {35 type Error = <&'de mut bincode::Deserializer<R, O> as Deserializer<'de>>::Error;3637 delegate! {38 fn deserialize_any()39 fn deserialize_bool()40 fn deserialize_u16()41 fn deserialize_u32()42 fn deserialize_u64()43 fn deserialize_i16()44 fn deserialize_i32()45 fn deserialize_i64()46 fn deserialize_f32()47 fn deserialize_f64()48 fn deserialize_u128()49 fn deserialize_i128()50 fn deserialize_u8()51 fn deserialize_i8()52 fn deserialize_unit()53 fn deserialize_char()54 fn deserialize_str()55 fn deserialize_string()56 fn deserialize_bytes()57 fn deserialize_byte_buf()58 fn deserialize_enum(name: &'static str, variants: &'static [&'static str])59 fn deserialize_tuple(len: usize)60 fn deserialize_option()61 fn deserialize_seq()62 fn deserialize_map()63 fn deserialize_struct(name: &'static str, fields: &'static [&'static str])64 fn deserialize_identifier()65 fn deserialize_newtype_struct(name: &'static str)66 fn deserialize_unit_struct(name: &'static str)67 fn deserialize_tuple_struct(name: &'static str, len: usize)68 fn deserialize_ignored_any()69 }7071 fn is_human_readable(&self) -> bool {72 false73 }74 }7576 // In build.rs, Source object is populated with empty values, deserializer wrapper loads correct values on deserialize11 return bincode::deserialize(include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")))77 let mut deserializer = bincode::Deserializer::from_slice(78 include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")),79 DefaultOptions::new()80 .with_fixint_encoding()12 .unwrap();81 .allow_trailing_bytes(),82 );8384 // Should not panic, stdlib.bincode is generated in build.rs85 LocExpr::deserialize(&mut deserializer).unwrap()13 }86 }148788 #[cfg(feature = "codegenerated-stdlib")]89 {90 include!(concat!(env!("OUT_DIR"), "/stdlib.rs"))91 }9293 #[cfg(not(feature = "codegenerated-stdlib"))]94 {15 jrsonnet_parser::parse(95 jrsonnet_parser::parse(16 STDLIB_STR,96 STDLIB_STR,17 &ParserSettings {97 &ParserSettings {18 file_name: Source::new_virtual(Cow::Borrowed("<std>"), STDLIB_STR.into()),98 file_name: Source::new_virtual(Cow::Borrowed("<std>"), STDLIB_STR.into()),19 },99 },20 )100 )21 .unwrap()101 .unwrap()102 }22}103}23104