mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-28 16:32:15 +00:00
Fix truncated declaration ranges
This commit is contained in:
parent
b47bcb58bc
commit
93c9a4afd9
@ -1621,6 +1621,7 @@ export class Parser extends DiagnosticEmitter {
|
|||||||
}
|
}
|
||||||
} while (!tn.skip(Token.CLOSEBRACE));
|
} while (!tn.skip(Token.CLOSEBRACE));
|
||||||
}
|
}
|
||||||
|
declaration.range.end = tn.pos;
|
||||||
return declaration;
|
return declaration;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1672,6 +1673,7 @@ export class Parser extends DiagnosticEmitter {
|
|||||||
}
|
}
|
||||||
} while (!tn.skip(Token.CLOSEBRACE));
|
} while (!tn.skip(Token.CLOSEBRACE));
|
||||||
}
|
}
|
||||||
|
declaration.range.end = tn.pos;
|
||||||
return Node.createClassExpression(declaration);
|
return Node.createClassExpression(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2195,7 +2197,7 @@ export class Parser extends DiagnosticEmitter {
|
|||||||
let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());
|
let identifier = Node.createIdentifierExpression(tn.readIdentifier(), tn.range());
|
||||||
if (tn.skip(Token.OPENBRACE)) {
|
if (tn.skip(Token.OPENBRACE)) {
|
||||||
let members = new Array<Statement>();
|
let members = new Array<Statement>();
|
||||||
let ns = Node.createNamespaceDeclaration(
|
let declaration = Node.createNamespaceDeclaration(
|
||||||
identifier,
|
identifier,
|
||||||
members,
|
members,
|
||||||
decorators,
|
decorators,
|
||||||
@ -2203,7 +2205,7 @@ export class Parser extends DiagnosticEmitter {
|
|||||||
tn.range(startPos, tn.pos)
|
tn.range(startPos, tn.pos)
|
||||||
);
|
);
|
||||||
while (!tn.skip(Token.CLOSEBRACE)) {
|
while (!tn.skip(Token.CLOSEBRACE)) {
|
||||||
let member = this.parseTopLevelStatement(tn, ns);
|
let member = this.parseTopLevelStatement(tn, declaration);
|
||||||
if (member) members.push(member);
|
if (member) members.push(member);
|
||||||
else {
|
else {
|
||||||
this.skipStatement(tn);
|
this.skipStatement(tn);
|
||||||
@ -2216,8 +2218,9 @@ export class Parser extends DiagnosticEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
declaration.range.end = tn.pos;
|
||||||
tn.skip(Token.SEMICOLON);
|
tn.skip(Token.SEMICOLON);
|
||||||
return ns;
|
return declaration;
|
||||||
} else {
|
} else {
|
||||||
this.error(
|
this.error(
|
||||||
DiagnosticCode._0_expected,
|
DiagnosticCode._0_expected,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user