mirror of
https://github.com/Noratrieb/brainfuck.git
synced 2026-01-14 13:35:00 +01:00
pretty (OwO)
This commit is contained in:
parent
deefc18959
commit
04dd019806
1 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ function lex(string) {
|
|||
if (['+', '-', '>', '<', '.', ',', '[', ']'].includes(char)) {
|
||||
tokens.push({
|
||||
char,
|
||||
span: i
|
||||
span: i,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -29,13 +29,13 @@ function Parser(tokens) {
|
|||
this.position = 0;
|
||||
}
|
||||
|
||||
Parser.prototype.next = function() {
|
||||
Parser.prototype.next = function () {
|
||||
const token = this.tokens[this.position];
|
||||
this.position++;
|
||||
return token;
|
||||
};
|
||||
|
||||
Parser.prototype.parse = function(isLoop) {
|
||||
Parser.prototype.parse = function (isLoop) {
|
||||
const body = [];
|
||||
let nextToken;
|
||||
while ((nextToken = this.next()) !== undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue