Skip to content

Commit

Permalink
Merge pull request #11927 from samgermain/transpile-while
Browse files Browse the repository at this point in the history
Add while loop transpile regex to build/transpile.js
  • Loading branch information
kroitor committed Feb 11, 2022
2 parents 31d2a4b + 49d3e56 commit d4d7025
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build/transpile.js
Expand Up @@ -310,6 +310,7 @@ class Transpiler {
[ / = new /g, ' = ' ], // python does not have a 'new' keyword
[ /console\.log\s/g, 'print' ],
[ /process\.exit\s+/g, 'sys.exit' ],
[ /(while \(.*\)) {/, '$1\:' ], // While loops replace bracket with :
[ /([^:+=\/\*\s-]+) \(/g, '$1(' ], // PEP8 E225 remove whitespaces before left ( round bracket
[ /\sand\(/g, ' and (' ],
[ /\sor\(/g, ' or (' ],
Expand Down

0 comments on commit d4d7025

Please sign in to comment.