1
0
mirror of https://github.com/fluencelabs/assemblyscript synced 2025-07-26 11:42:08 +00:00

Add a 'call_indirect' builtin to emit arbitrary calls (might trap at runtime); Optimize 'for' loop compilation a bit

This commit is contained in:
dcodeIO
2018-05-25 15:59:17 +02:00
parent 51ede113dd
commit 7ad13f9d65
47 changed files with 3311 additions and 22111 deletions

@@ -364,13 +364,6 @@ export class Parser extends DiagnosticEmitter {
var token = tn.next();
var startPos = tn.tokenPos;
// 'void'
if (token == Token.VOID) {
return Node.createType(
Node.createIdentifierExpression("void", tn.range()), [], false, tn.range(startPos, tn.pos)
);
}
var type: CommonTypeNode;
// '(' ...
@@ -437,6 +430,12 @@ export class Parser extends DiagnosticEmitter {
return null;
}
// 'void'
} else if (token == Token.VOID) {
type = Node.createType(
Node.createIdentifierExpression("void", tn.range()), [], false, tn.range(startPos, tn.pos)
);
// 'this'
} else if (token == Token.THIS) {
type = Node.createType(