import{a as o,b as c,c as l,d as s,e as u,g as f,q as E,w as m,y as v}from"./chunk-L5GCOVLC.mjs";import{a as i}from"./chunk-AQ6EADP3.mjs";var h=class extends v{static{i(this,"RailroadEbnfTokenBuilder")}static{o(this,"RailroadEbnfTokenBuilder")}constructor(){super(["railroad-ebnf-beta"])}},b=o(a=>{let e=a.slice(1,-1),r="";for(let t=0;t<e.length;t++){let n=e[t];if(n==="\\"&&t+1<e.length){t++;let d=e[t];switch(d){case"n":r+=`
`;break;case"r":r+="\r";break;case"t":r+="	";break;default:r+=d}continue}r+=n}return r},"decodeEscapedString"),C=class extends m{static{i(this,"RailroadEbnfValueConverter")}static{o(this,"RailroadEbnfValueConverter")}runConverter(a,e,r){let t=super.runConverter(a,e,r);if(a.name==="TITLE"&&typeof t=="string"){let n=t.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return b(n)}return t}runCustomConverter(a,e,r){if(a.name==="EBNF_STRING")return b(e);if(a.name==="EBNF_SPECIAL_SEQUENCE")return e.slice(1,-1).trim()}},R={parser:{TokenBuilder:o(()=>new h,"TokenBuilder"),ValueConverter:o(()=>new C,"ValueConverter")}};function S(a=u){let e=s(l(a),f),r=s(c({shared:e}),E,R);return e.ServiceRegistry.register(r),{shared:e,RailroadEbnf:r}}i(S,"createRailroadEbnfServices");o(S,"createRailroadEbnfServices");export{R as a,S as b};
