replace Locals with scopeable MethodDeclarations to allow labels and types to be stored

This commit is contained in:
Dave Holoway
2020-06-12 13:32:15 +01:00
parent ac9a7ed43a
commit c70b75783e
4 changed files with 247 additions and 182 deletions

View File

@@ -55,6 +55,18 @@ class TokenList {
return false;
}
/**
* Check if the current token matches the specified kind and consumes it
* @param {string} kind
*/
isKind(kind) {
if (this.current && this.current.kind === kind) {
this.inc();
return true;
}
return false;
}
/**
* Check if the current token matches the specified value and consumes it or reports an error
* @param {string} value