Skip to content

Commit 185fd46

Browse files
committed
--no-edit
1 parent 835bdf6 commit 185fd46

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A restricted Python to idiomatic JavaScript / Ruby / Go / C# translator
77

88
[Pseudo](https://github.com/alehander42/pseudo) is a framework for high level code generation: it is used by this compiler to translate a subset of Python to all Pseudo-supported languages
99

10-
**If you are using Python3.5 and you experience problems with an already installed version of pseudo-python, please upgrade it to `0.2.18` (`pip3 install pseudo-python --upgrade`)**
10+
**If you are using Python3.5 and you experience problems with an already installed version of pseudo-python, please upgrade it to `0.2.20` (`pip3 install pseudo-python --upgrade`)**
1111

1212

1313

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.18
1+
0.2.20

pseudo_python/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import pseudo_python.parser
22
import pseudo_python.ast_translator
3+
import yaml
34

45
def translate(source):
5-
return pseudo_python.ast_translator.ASTTranslator(pseudo_python.parser.parse(source), source).translate()
6+
return pseudo_python.ast_translator.ASTTranslator(pseudo_python.parser.parse(source), source).translate()
7+
8+
def translate_to_yaml(source):
9+
yaml.Dumper.ignore_aliases = lambda *args : True
10+
return yaml.dump(translate(source))

pseudo_python/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import sys
44
import pseudo_python
55
import pseudo_python.errors
6-
import yaml
76
import pseudo
87
import pseudo.errors
98
from colorama import init
@@ -41,8 +40,7 @@ def main():
4140
base, _ = os.path.splitext(filename)
4241
try:
4342
if len(sys.argv) == 2:
44-
yaml.Dumper.ignore_aliases = lambda *args : True
45-
clj = yaml.dump(pseudo_python.translate(source))
43+
clj = pseudo_python.translate_to_yaml(source)
4644
with open('%s.pseudo.yaml' % base, 'w') as f:
4745
f.write(clj)
4846
print(colored('OK\nsaved pseudo ast as %s.pseudo.yaml' % base, 'green'))
@@ -72,8 +70,10 @@ def main():
7270
print(colored('\nright:\n%s' % e.right, 'green'))
7371
if e.wrong:
7472
print(colored('\nwrong:\n%s' % e.wrong, 'red'))
73+
exit(1)
7574
except pseudo.errors.PseudoError as e:
7675
print(colored('Pseudo error:\n%s' % e, 'red'))
76+
exit(1)
7777

7878
if __name__ == '__main__':
7979
main()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='pseudo-python',
5-
version='0.2.18',
5+
version='0.2.20',
66
description='a python3 to pseudo compiler',
77
author='Alexander Ivanov',
88
author_email='alehander42@gmail.com',

0 commit comments

Comments
 (0)