mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Added syntactic classification for templates; also made 'spans' a NodeArray.
This commit is contained in:
@@ -1406,13 +1406,17 @@ module ts {
|
||||
template.head = parseLiteralNode();
|
||||
Debug.assert(template.head.kind === SyntaxKind.TemplateHead, "Template head has wrong token kind");
|
||||
|
||||
var templateSpans: TemplateSpan[] = [];
|
||||
var templateSpans = <NodeArray<TemplateSpan>>[];
|
||||
templateSpans.pos = getNodePos();
|
||||
|
||||
do {
|
||||
templateSpans.push(parseTemplateSpan());
|
||||
}
|
||||
while (templateSpans[templateSpans.length - 1].literal.kind === SyntaxKind.TemplateMiddle)
|
||||
|
||||
|
||||
templateSpans.end = getNodeEnd();
|
||||
template.templateSpans = templateSpans;
|
||||
|
||||
return finishNode(template);
|
||||
}
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ module ts {
|
||||
|
||||
export interface TemplateExpression extends Expression {
|
||||
head: LiteralExpression;
|
||||
templateSpans: TemplateSpan[]
|
||||
templateSpans: NodeArray<TemplateSpan>;
|
||||
}
|
||||
|
||||
export interface TemplateSpan extends Node {
|
||||
|
||||
@@ -4901,6 +4901,10 @@ module ts {
|
||||
// TODO: we should get another classification type for these literals.
|
||||
return ClassificationTypeNames.stringLiteral;
|
||||
}
|
||||
else if (isTemplateLiteralKind(tokenKind)) {
|
||||
// TODO (drosen): we should *also* get another classification type for these literals.
|
||||
return ClassificationTypeNames.stringLiteral;
|
||||
}
|
||||
else if (tokenKind === SyntaxKind.Identifier) {
|
||||
switch (token.parent.kind) {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
|
||||
Reference in New Issue
Block a user