mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 09:21:35 +00:00
Fix some diagnostic issues when skipping invalid statements, see #80; Make game-of-life example somewhat interactive; Update dist files
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
* @module builtins
|
||||
*//***/
|
||||
|
||||
import {
|
||||
import {
|
||||
Compiler,
|
||||
ConversionKind,
|
||||
|
||||
|
@ -176,6 +176,12 @@ export class Parser extends DiagnosticEmitter {
|
||||
var exportStart: i32 = 0;
|
||||
var exportEnd: i32 = 0;
|
||||
if (tn.skip(Token.EXPORT)) {
|
||||
if (tn.skip(Token.DEFAULT)) {
|
||||
this.error(
|
||||
DiagnosticCode.Operation_not_supported,
|
||||
tn.range()
|
||||
);
|
||||
}
|
||||
if (startPos < 0) startPos = tn.tokenPos;
|
||||
flags |= CommonFlags.EXPORT;
|
||||
exportStart = tn.tokenPos;
|
||||
@ -3181,11 +3187,8 @@ export class Parser extends DiagnosticEmitter {
|
||||
let nextToken = tn.peek(true);
|
||||
if (
|
||||
nextToken == Token.ENDOFFILE || // next step should handle this
|
||||
nextToken == Token.CLOSEBRACE // current step should handle this
|
||||
nextToken == Token.SEMICOLON // end of the statement for sure
|
||||
) {
|
||||
break;
|
||||
}
|
||||
if (nextToken == Token.SEMICOLON) { // end of the statement for sure
|
||||
tn.next();
|
||||
break;
|
||||
}
|
||||
|
@ -905,7 +905,6 @@ export class Tokenizer extends DiagnosticEmitter {
|
||||
this.token = state.token;
|
||||
this.tokenPos = state.tokenPos;
|
||||
this.nextToken = -1;
|
||||
reusableState = state;
|
||||
}
|
||||
|
||||
range(start: i32 = -1, end: i32 = -1): Range {
|
||||
|
Reference in New Issue
Block a user