diff --git a/README.md b/README.md index a401258c..db12e609 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,14 @@ function parseBetterJSAlternative(code) { **Good:** ```javascript +function parseBetterJSAlternative(code) { + const tokens = tokenize(code); + const ast = lexer(tokens); + ast.forEach((node) => { + // parse... + }); +} + function tokenize(code) { const REGEXES = [ // ... @@ -367,14 +375,6 @@ function lexer(tokens) { return ast; } - -function parseBetterJSAlternative(code) { - const tokens = tokenize(code); - const ast = lexer(tokens); - ast.forEach((node) => { - // parse... - }); -} ``` **[⬆ back to top](#table-of-contents)**