angular/packages/compiler/src/ml_parser/xml_parser.ts

23 lines
705 B
TypeScript
Raw Normal View History

2016-07-21 20:56:58 +00:00
/**
* @license
* Copyright Google LLC All Rights Reserved.
2016-07-21 20:56:58 +00:00
*
* 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 {TokenizeOptions} from './lexer';
import {Parser, ParseTreeResult} from './parser';
2016-07-21 20:56:58 +00:00
import {getXmlTagDefinition} from './xml_tags';
export class XmlParser extends Parser {
constructor() {
super(getXmlTagDefinition);
}
2016-07-21 20:56:58 +00:00
override parse(source: string, url: string, options: TokenizeOptions = {}): ParseTreeResult {
// Blocks and let declarations aren't supported in an XML context.
return super.parse(source, url, {...options, tokenizeBlocks: false, tokenizeLet: false});
2016-07-21 20:56:58 +00:00
}
}