Pete Bacon Darwin 673ac2945c refactor(compiler): use options argument for parsers (#28055)
This commit consolidates the options that can modify the
parsing of text (e.g. HTML, Angular templates, CSS, i18n)
into an AST for further processing into a single `options`
hash.

This makes the code cleaner and more readable, but also
enables us to support further options to parsing without
triggering wide ranging changes to code that should not
be affected by these new options.  Specifically, it will let
us pass information about the placement of a template
that is being parsed in its containing file, which is essential
for accurate SourceMap processing.

PR Close #28055
2019-02-12 20:58:27 -08:00

22 lines
626 B
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {getHtmlTagDefinition} from './html_tags';
import {TokenizeOptions} from './lexer';
import {ParseTreeResult, Parser} from './parser';
export {ParseTreeResult, TreeError} from './parser';
export class HtmlParser extends Parser {
constructor() { super(getHtmlTagDefinition); }
parse(source: string, url: string, options?: TokenizeOptions): ParseTreeResult {
return super.parse(source, url, options);
}
}