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

Method constructor

packages/compiler/src/ml_parser/lexer.ts:190–217  ·  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

188 * @param options Configuration of the tokenization.
189 */
190 constructor(
191 _file: ParseSourceFile,
192 private _getTagDefinition: (tagName: string) => TagDefinition,
193 options: TokenizeOptions,
194 ) {
195 this._tokenizeIcu = options.tokenizeExpansionForms || false;
196 this._leadingTriviaCodePoints =
197 options.leadingTriviaChars && options.leadingTriviaChars.map((c) => c.codePointAt(0) || 0);
198 const range = options.range || {
199 endPos: _file.content.length,
200 startPos: 0,
201 startLine: 0,
202 startCol: 0,
203 };
204 this._cursor = options.escapedString
205 ? new EscapedCharacterCursor(_file, range)
206 : new PlainCharacterCursor(_file, range);
207 this._preserveLineEndings = options.preserveLineEndings || false;
208 this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false;
209 this._tokenizeBlocks = options.tokenizeBlocks ?? true;
210 this._tokenizeLet = options.tokenizeLet ?? true;
211 this._selectorlessEnabled = options.selectorlessEnabled ?? false;
212 try {
213 this._cursor.init();
214 } catch (e) {
215 this.handleError(e);
216 }
217 }
218
219 private _processCarriageReturns(content: string): string {
220 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