1"use strict";(globalThis.webpackChunkopenrag_docs=globalThis.webpackChunkopenrag_docs||[]).push([[2449],{2449(e,r,t){t.d(r,{diagram:()=>f});var n=t(7977),a=t(7454),s=(t(2422),t(9069),t(1293)),l=t(6827),p=t(8731),i=(0,p.sB)().RailroadAbnf.parser.LangiumParser,o=(0,l.K)(e=>{const r=e.alternatives.map(m);return 1===r.length?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),m=(0,l.K)(e=>{const r=e.elements.map(c);return 1===r.length?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),u=(0,l.K)(e=>{if(e.includes("*")){const[r,t]=e.split("*");return{min:r?parseInt(r,10):0,max:t?parseInt(t,10):1/0}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),c=(0,l.K)(e=>{const r=d(e.primary);if(!e.repeat)return r;const{min:t,max:n}=u(e.repeat);return 0===t&&1===n?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:n}},"transformElement"),d=(0,l.K)(e=>{switch(e.$type){case"AbnfStringLiteral":case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return o(e.element);case"AbnfOptionalGroup":return{type:"optional",element:o(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),b=(0,l.K)(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),g=(0,l.K)(e=>{(0,a.S)(e,n.db),e.title&&n.db.setTitle(e.title),e.rules.map(e=>n.db.addRule(b(e)))},"populateDb"),f={parser:{parse:(0,l.K)(e=>{n.db.clear(),s.R.debug("[ABNF Parser] Starting Langium parse");const r=i.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p.zg(r);const t=r.value;s.R.debug("[ABNF Parser] Parsed rules:",t.rules.length),g(t),s.R.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n.db}},db:n.db,renderer:n.U,styles:n.$}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.