pretty (OwO)

This commit is contained in:
nora 2022-05-16 12:32:56 +02:00
parent deefc18959
commit 04dd019806

View file

@ -11,7 +11,7 @@ function lex(string) {
if (['+', '-', '>', '<', '.', ',', '[', ']'].includes(char)) { if (['+', '-', '>', '<', '.', ',', '[', ']'].includes(char)) {
tokens.push({ tokens.push({
char, char,
span: i span: i,
}); });
} }
} }
@ -29,13 +29,13 @@ function Parser(tokens) {
this.position = 0; this.position = 0;
} }
Parser.prototype.next = function() { Parser.prototype.next = function () {
const token = this.tokens[this.position]; const token = this.tokens[this.position];
this.position++; this.position++;
return token; return token;
}; };
Parser.prototype.parse = function(isLoop) { Parser.prototype.parse = function (isLoop) {
const body = []; const body = [];
let nextToken; let nextToken;
while ((nextToken = this.next()) !== undefined) { while ((nextToken = this.next()) !== undefined) {