mirror of
https://github.com/jamiebuilds/the-super-tiny-compiler.git
synced 2024-10-27 20:34:08 +00:00
refactor: use const replace let
This commit is contained in:
parent
d8d4013045
commit
bc075ca048
@ -436,7 +436,7 @@ function tokenizer(input) {
|
|||||||
//
|
//
|
||||||
// So here we're just going to test for existence and if it does exist we're
|
// So here we're just going to test for existence and if it does exist we're
|
||||||
// going to just `continue` on.
|
// going to just `continue` on.
|
||||||
let WHITESPACE = /\s/;
|
const WHITESPACE = /\s/;
|
||||||
if (WHITESPACE.test(char)) {
|
if (WHITESPACE.test(char)) {
|
||||||
current++;
|
current++;
|
||||||
continue;
|
continue;
|
||||||
@ -451,7 +451,7 @@ function tokenizer(input) {
|
|||||||
// Only two separate tokens
|
// Only two separate tokens
|
||||||
//
|
//
|
||||||
// So we start this off when we encounter the first number in a sequence.
|
// 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)) {
|
if (NUMBERS.test(char)) {
|
||||||
|
|
||||||
// We're going to create a `value` string that we are going to push
|
// We're going to create a `value` string that we are going to push
|
||||||
@ -511,7 +511,7 @@ function tokenizer(input) {
|
|||||||
// ^^^
|
// ^^^
|
||||||
// Name token
|
// Name token
|
||||||
//
|
//
|
||||||
let LETTERS = /[a-z]/i;
|
const LETTERS = /[a-z]/i;
|
||||||
if (LETTERS.test(char)) {
|
if (LETTERS.test(char)) {
|
||||||
let value = '';
|
let value = '';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user