|
|
|
|
@ -22,12 +22,14 @@ export default function read_context(parser) {
|
|
|
|
|
const code = full_char_code_at(parser.template, i);
|
|
|
|
|
if (isIdentifierStart(code, true)) {
|
|
|
|
|
const name = /** @type {string} */ (parser.read_identifier());
|
|
|
|
|
const typeAnnotation = read_type_annotation(parser);
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
type: 'Identifier',
|
|
|
|
|
name,
|
|
|
|
|
start,
|
|
|
|
|
end: parser.index,
|
|
|
|
|
typeAnnotation: read_type_annotation(parser)
|
|
|
|
|
typeAnnotation
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -81,6 +83,10 @@ export default function read_context(parser) {
|
|
|
|
|
).left;
|
|
|
|
|
|
|
|
|
|
expression.typeAnnotation = read_type_annotation(parser);
|
|
|
|
|
if (expression.typeAnnotation) {
|
|
|
|
|
expression.end = expression.typeAnnotation.end;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return expression;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
parser.acorn_error(error);
|
|
|
|
|
|