MCPcopy Create free account
hub / github.com/angular/angular / constructor

Method constructor

packages/compiler/src/ml_parser/lexer.ts:178–204  ·  view source on GitHub ↗

* @param _file The html source file being tokenized. * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name. * @param options Configuration of the tokenization.

(
    _file: ParseSourceFile,
    private _getTagDefinition: (tagName: string) => TagDefinition,
    options: TokenizeOptions,
  )

Source from the content-addressed store, hash-verified

176 * @param options Configuration of the tokenization.
177 */
178 constructor(
179 _file: ParseSourceFile,
180 private _getTagDefinition: (tagName: string) => TagDefinition,
181 options: TokenizeOptions,
182 ) {
183 this._tokenizeIcu = options.tokenizeExpansionForms || false;
184 this._leadingTriviaCodePoints =
185 options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);
186 const range = options.range || {
187 endPos: _file.content.length,
188 startPos: 0,
189 startLine: 0,
190 startCol: 0,
191 };
192 this._cursor = options.escapedString
193 ? new EscapedCharacterCursor(_file, range)
194 : new PlainCharacterCursor(_file, range);
195 this._preserveLineEndings = options.preserveLineEndings || false;
196 this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
197 this._tokenizeBlocks = options.tokenizeBlocks ?? true;
198 this._tokenizeLet = options.tokenizeLet ?? true;
199 try {
200 this._cursor.init();
201 } catch (e) {
202 this.handleError(e);
203 }
204 }
205
206 private _processCarriageReturns(content: string): string {
207 if (this._preserveLineEndings) {

Callers

nothing calls this directly

Calls 3

handleErrorMethod · 0.95
mapMethod · 0.80
initMethod · 0.65

Tested by

no test coverage detected