Skip to content

Commit 64a57f1

Browse files
Merge pull request ryanmcdermott#239 from fknipp/patch-1
Changing order in example of *Functions should only be one level …*
2 parents bd05a5f + 3ada142 commit 64a57f1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,14 @@ function parseBetterJSAlternative(code) {
343343

344344
**Good:**
345345
```javascript
346+
function parseBetterJSAlternative(code) {
347+
const tokens = tokenize(code);
348+
const ast = lexer(tokens);
349+
ast.forEach((node) => {
350+
// parse...
351+
});
352+
}
353+
346354
function tokenize(code) {
347355
const REGEXES = [
348356
// ...
@@ -367,14 +375,6 @@ function lexer(tokens) {
367375

368376
return ast;
369377
}
370-
371-
function parseBetterJSAlternative(code) {
372-
const tokens = tokenize(code);
373-
const ast = lexer(tokens);
374-
ast.forEach((node) => {
375-
// parse...
376-
});
377-
}
378378
```
379379
**[⬆ back to top](#table-of-contents)**
380380

0 commit comments

Comments
 (0)