forked from nanobowers/py2cr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing yaml require from py2cr, scaffolding for num.cr
- Loading branch information
1 parent
9a7d37c
commit 114c817
Showing
7 changed files
with
137 additions
and
72 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import ast | ||
from .translator import * | ||
|
||
class SixMoves(CrystalTranslator): | ||
def __init__(self): | ||
self.python_module_name = "six.moves" | ||
self.crystal_require = None | ||
|
||
def range(funcdb): | ||
# six.moves.range() => range() | ||
return "PyRange.range(%s)" % ", ".join(funcdb.crystal_args) | ||
|
||
class Six(CrystalTranslator): | ||
attribute_map = { | ||
"PY2": "false", | ||
"PY3": "true", | ||
"integer_types": "[Int32]" | ||
} | ||
def __init__(self): | ||
self.python_module_name = "six" | ||
self.crystal_require = None | ||
|
||
def itervalues(funcdb): | ||
receiver = funcdb.crystal_args[0] | ||
return f"{receiver}.values" | ||
|
||
def iteritems(funcdb): | ||
receiver = funcdb.crystal_args[0] | ||
return f"{receiver}.to_a" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters