UNPKG

code-server

Version:

Run VS Code on a remote server.

2 lines (1 loc) • 2.14 kB
import{a,b as p,c as u}from"./chunk-5TI3OQE5.js";import{a as l}from"./chunk-2S6PUNXZ.js";import{b as m}from"./chunk-R6TTN2K4.js";import"./chunk-MORPLMM4.js";import"./chunk-PAO23QCD.js";import"./chunk-NZ3Q2WJX.js";import{b as s}from"./chunk-PPKVOE2H.js";import"./chunk-JXO2KM4E.js";import"./chunk-PNBHH3ZV.js";import"./chunk-ABRXOUHG.js";import"./chunk-QSWXSH5R.js";import"./chunk-U4VSMEDZ.js";import"./chunk-CQHAQPZP.js";import"./chunk-4HJKLDAT.js";import"./chunk-ROB3ZELR.js";import"./chunk-JZV3OND4.js";import"./chunk-JHQ3LEJ2.js";import"./chunk-BQR5VGCX.js";import"./chunk-ECAF5OLA.js";import"./chunk-QRLMLG33.js";import"./chunk-5Z3D3SW5.js";import{b as i}from"./chunk-SNB7PWCV.js";import"./chunk-CU3WNRKO.js";import{a as n}from"./chunk-5ZAMBDF5.js";import"./chunk-3RNHDNP5.js";var d=s().Railroad.parser.LangiumParser,t=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{let r=e.elements.map(t);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{let r=e.alternatives.map(t);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:t(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:t(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:t(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:t(e.definition)}),"transformRule"),f=n(e=>{l(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(c(r)))},"populateDb"),g={parse:n(e=>{a.clear(),i.debug("[Railroad Parser] Starting Langium parse");let r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new m(r);let o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),f(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:a}},y={parser:g,db:a,renderer:u,styles:p},w=y;export{w as default,y as diagram};