Browse Source

Somehow I wasn't initializing variables?

master
Dylan Baker 7 years ago
parent
commit
22512cf334
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/lexer.js

+ 3
- 3
src/lexer.js View File

9
 }
9
 }
10
 
10
 
11
 const scan = source => {
11
 const scan = source => {
12
-  pos = 0
13
-  line = 1
14
-  tokens = []
12
+  let pos = 0
13
+  let line = 1
14
+  let tokens = []
15
 
15
 
16
   while (pos < source.length) {
16
   while (pos < source.length) {
17
     if (source[pos].match(/\(/)) {
17
     if (source[pos].match(/\(/)) {

Loading…
Cancel
Save