utils/node_modules/@microsoft/tsdoc/lib-commonjs/parser/TokenSequence.js.map

1 line
5.7 KiB
Plaintext
Raw Normal View History

2024-02-07 01:33:07 -05:00
{"version":3,"file":"TokenSequence.js","sourceRoot":"","sources":["../../src/parser/TokenSequence.ts"],"names":[],"mappings":";;;AAEA,yCAAwC;AAWxC;;;GAGG;AACH;IASE,uBAAmB,UAAoC;QACrD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACW,yBAAW,GAAzB,UAA0B,aAA4B;QACpD,OAAO,IAAI,aAAa,CAAC,EAAE,aAAa,eAAA,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;IAC1E,CAAC;IAKD,sBAAW,qCAAU;QAHrB;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,WAAW,CAAC;QAC1B,CAAC;;;OAAA;IAKD,sBAAW,mCAAQ;QAHnB;;WAEG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,CAAC;;;OAAA;IAED,sBAAW,iCAAM;aAAjB;YACE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3E,CAAC;;;OAAA;IAED;;;OAGG;IACI,sCAAc,GAArB,UAAsB,UAAkB,EAAE,QAAgB;QACxD,OAAO,IAAI,aAAa,CAAC;YACvB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,UAAU,EAAE,UAAU;YACtB,QAAQ,EAAE,QAAQ;SACnB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACI,8CAAsB,GAA7B;QACE,IAAI,IAAI,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E,CAAC,CAAC;SACpF;IACH,CAAC;IACH,oBAAC;AAAD,CAAC,AAhGD,IAgGC;AAhGY,sCAAa","sourcesContent":["import { ParserContext } from './ParserContext';\r\nimport { Token } from './Token';\r\nimport { TextRange } from './TextRange';\r\n\r\n/**\r\n * Constructor parameters for {@link TokenSequence}\r\n */\r\nexport interface ITokenSequenceParameters {\r\n parserContext: ParserContext;\r\n startIndex: number;\r\n endIndex: number;\r\n}\r\n\r\n/**\r\n * Represents a sequence of tokens extracted from `ParserContext.tokens`.\r\n * This sequence is defined by a starting index and ending index into that array.\r\n */\r\nexport class TokenSequence {\r\n /**\r\n * The associated parser context that the tokens come from.\r\n */\r\n public readonly parserContext: ParserContext;\r\n\r\n private _startIndex: number;\r\n private _endIndex: number;\r\n\r\n public constructor(parameters: ITokenSequenceParameters) {\r\n this.parserContext = parameters.parserContext;\r\n this._startIndex = parameters.startIndex;\r\n this._endIndex = parameters.endIndex;\r\n this._validateBounds();\r\n }\r\n\r\n /**\r\n * Constructs a TokenSequence object with no tokens.\r\n */\r\n public static createEmpty(parserContext: ParserContext): TokenSequence {\r\n return new TokenSequence({ parserContext, startIndex: 0, endIndex: 0 });\r\n }\r\n\r\n /**\r\n * The starting index into the associated `ParserContext.tokens` list.\r\n */\r\n public get startIndex(): number {\r\n return this._startIndex;\r\n }\r\n\r\n /**\r\n * The (non-inclusive) ending index into the associated `ParserContext.tokens` list.\r\n */\r\n public get endIndex(): number {\r\n return this._endIndex;\r\n }\r\n\r\n public get tokens(): ReadonlyArray<Token> {\r\n return this.parserContext.tokens.slice(this._startIndex, this._endIndex);\r\n }\r\n\r\n /**\r\n * Constructs a TokenSequence that corresponds to a different range of tokens,\r\n * e.g. a subrange.\r\n */\r\n public getNewSequence(startIndex: number, end