UNPKG

code-server

Version:

Run VS Code on a remote server.

2 lines (1 loc) • 2.12 kB
import{a,b as p,c as u}from"./chunk-RELJRPBZ.js";import{a as l}from"./chunk-IXVJTV6F.js";import{b as m}from"./chunk-LTUZSHNZ.js";import"./chunk-ZJI6YJYA.js";import"./chunk-M3D33L6B.js";import"./chunk-OIILI2Y7.js";import"./chunk-YZVOYOFK.js";import"./chunk-O7QBUQAH.js";import"./chunk-W7OL4OKF.js";import"./chunk-VVFC3ZDE.js";import{b as s}from"./chunk-FXSM7W65.js";import"./chunk-76X5CPAH.js";import"./chunk-AOZRU6DS.js";import"./chunk-BSFAT5OX.js";import"./chunk-G7LOUNJ6.js";import"./chunk-6BTXFTHE.js";import"./chunk-K2TQYY52.js";import"./chunk-CH3ASREE.js";import"./chunk-BO5ICQM6.js";import"./chunk-NB6J6K2M.js";import"./chunk-YX6DBKFT.js";import{b as i}from"./chunk-TOKYXDRE.js";import{a as n}from"./chunk-TZZ523SA.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};