File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -345,8 +345,8 @@ function parseBetterJSAlternative(code) {
345
345
``` javascript
346
346
function parseBetterJSAlternative (code ) {
347
347
const tokens = tokenize (code);
348
- const ast = lexer (tokens);
349
- ast .forEach ((node ) => {
348
+ const syntaxTree = parse (tokens);
349
+ syntaxTree .forEach ((node ) => {
350
350
// parse...
351
351
});
352
352
}
@@ -367,13 +367,13 @@ function tokenize(code) {
367
367
return tokens;
368
368
}
369
369
370
- function lexer (tokens ) {
371
- const ast = [];
370
+ function parse (tokens ) {
371
+ const syntaxTree = [];
372
372
tokens .forEach ((token ) => {
373
- ast .push ( /* ... */ );
373
+ syntaxTree .push ( /* ... */ );
374
374
});
375
375
376
- return ast ;
376
+ return syntaxTree ;
377
377
}
378
378
```
379
379
** [ ⬆ back to top] ( #table-of-contents ) **
You can’t perform that action at this time.
0 commit comments