From bc075ca048b4b30387d58bb82073b4dcb021ee13 Mon Sep 17 00:00:00 2001 From: "greenmashimaro@gmail.com" Date: Thu, 27 Apr 2023 19:05:26 +0800 Subject: [PATCH] refactor: use const replace let --- the-super-tiny-compiler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/the-super-tiny-compiler.js b/the-super-tiny-compiler.js index 42437ca..8b73730 100755 --- a/the-super-tiny-compiler.js +++ b/the-super-tiny-compiler.js @@ -436,7 +436,7 @@ function tokenizer(input) { // // So here we're just going to test for existence and if it does exist we're // going to just `continue` on. - let WHITESPACE = /\s/; + const WHITESPACE = /\s/; if (WHITESPACE.test(char)) { current++; continue; @@ -451,7 +451,7 @@ function tokenizer(input) { // Only two separate tokens // // So we start this off when we encounter the first number in a sequence. - let NUMBERS = /[0-9]/; + const NUMBERS = /[0-9]/; if (NUMBERS.test(char)) { // We're going to create a `value` string that we are going to push @@ -511,7 +511,7 @@ function tokenizer(input) { // ^^^ // Name token // - let LETTERS = /[a-z]/i; + const LETTERS = /[a-z]/i; if (LETTERS.test(char)) { let value = '';