Skip to content

Commit

Permalink
added more transpiler fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jun 13, 2018
1 parent 54f2448 commit 7556f4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,14 @@ const pythonRegexes = [
[ /typeof\s+([^\s\[]+)(?:\s|\[(.+?)\])\s+\!\=\=?\s+\'undefined\'/g, '$1[$2] is not None' ],
[ /typeof\s+([^\s]+)\s+\=\=\=?\s+\'undefined\'/g, '$1 is None' ],
[ /typeof\s+([^\s]+)\s+\!\=\=?\s+\'undefined\'/g, '$1 is not None' ],
[ /typeof\s+(.+?)\s+\=\=\=?\s+\'undefined\'/g, '$1 is None' ],
[ /typeof\s+(.+?)\s+\!\=\=?\s+\'undefined\'/g, '$1 is not None' ],
[ /typeof\s+([^\s\[]+)(?:\s|\[(.+?)\])\s+\=\=\=?\s+\'string\'/g, 'isinstance($1[$2], basestring)' ],
[ /typeof\s+([^\s\[]+)(?:\s|\[(.+?)\])\s+\!\=\=?\s+\'string\'/g, 'not isinstance($1[$2], basestring)' ],
[ /typeof\s+([^\s]+)\s+\=\=\=?\s+\'string\'/g, 'isinstance($1, basestring)' ],
[ /typeof\s+([^\s]+)\s+\!\=\=?\s+\'string\'/g, 'not isinstance($1, basestring)' ],
[ /undefined/g, 'None' ],
[ /null/g, 'None' ],
[ /\=\=\=?/g, '==' ],
[ /\!\=\=?/g, '!=' ],
[ /this\.stringToBinary\s*\((.*)\)/g, '$1' ],
Expand Down Expand Up @@ -828,7 +831,6 @@ function transpileDateTimeTests () {
const pythonHeader =
"\n\
import ccxt # noqa: F402\n\
exchange = ccxt.Exchange\n\
\n\
# ----------------------------------------------------------------------------\n\
\n"
Expand Down

0 comments on commit 7556f4e

Please sign in to comment.