| 70 | `,type:Le.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),q(t,Tc)&&D(t.modes,(i,s)=>{D(i,(a,o)=>{if($t(a))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}> |
| 71 | `,type:Le.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(q(a,"LONGER_ALT")){let c=Ze(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];D(c,l=>{!$t(l)&&!Pe(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${a.name}> outside of mode <${s}> |
| 72 | `,type:Le.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function gm(t,e,r){let n=[],i=!1,s=Or(Ve(Ce(t.modes))),a=In(s,c=>c[Qn]===He.NA),o=vm(r);return e&&D(a,c=>{let l=xm(c,o);if(l!==!1){let p={message:yE(c,l),type:l.issue,tokenType:c};n.push(p)}else q(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):yc(o,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. |
| 73 | This Lexer has been defined to track line and column information, |
| 74 | But none of the Token Types can be identified as matching a line terminator. |
| 75 | See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS |
| 76 | for details.`,type:Le.NO_LINE_BREAKS_FLAGS}),n}function ym(t){let e={},r=Pr(t);return D(r,n=>{let i=t[n];if(Ze(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Tm(t){let e=t.PATTERN;if(tr(e))return!1;if(mr(e))return!0;if(q(e,"exec"))return!0;if(mt(e))return!1;throw Error("non exhaustive match")}function gE(t){return mt(t)&&t.length===1?t.charCodeAt(0):!1}var Rm={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function xm(t,e){if(q(t,"LINE_BREAKS"))return!1;if(tr(t.PATTERN)){try{yc(e,t.PATTERN)}catch(r){return{issue:Le.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(mt(t.PATTERN))return!1;if(Tm(t))return{issue:Le.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function yE(t,e){if(e.issue===Le.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern. |
| 77 | The problem is in the <${t.name}> Token Type |
| 78 | Root cause: ${e.errMsg}. |
| 79 | For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Le.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option. |