2016-07-21 20:56:58 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
2020-05-19 19:08:49 +00:00
|
|
|
* 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
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-08 22:10:19 +00:00
|
|
|
import {TokenizeOptions} from './lexer';
|
2020-04-08 17:14:18 +00:00
|
|
|
import {Parser, ParseTreeResult} from './parser';
|
2016-07-21 20:56:58 +00:00
|
|
|
import {getXmlTagDefinition} from './xml_tags';
|
|
|
|
|
|
|
|
|
|
export class XmlParser extends Parser {
|
2020-04-08 17:14:18 +00:00
|
|
|
constructor() {
|
|
|
|
|
super(getXmlTagDefinition);
|
|
|
|
|
}
|
2016-07-21 20:56:58 +00:00
|
|
|
|
2023-07-06 07:05:00 +00:00
|
|
|
override parse(source: string, url: string, options: TokenizeOptions = {}): ParseTreeResult {
|
2024-04-30 12:33:08 +00:00
|
|
|
// 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
|
|
|
}
|
|
|
|
|
}
|