Skip to content

Commit

Permalink
fix ouput
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed May 21, 2021
1 parent 8beb95c commit ff0bfae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ti842py/__version__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__title__ = "ti842py"
__description__ = "TI-BASIC to Python 3 Transpiler"
__url__ = "https://github.com/TabulateJarl8/ti842py"
__version__ = "0.4.15"
__version__ = "0.4.16"
__author__ = "Tabulate"
__author_email__ = "[email protected]"
__license__ = "GPLv3"
Expand Down
9 changes: 9 additions & 0 deletions ti842py/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

try:
from .tiParser import TIBasicParser
from .__version__ import __version__
except ImportError:
from tiParser import TIBasicParser
from __version__ import __version__


def transpile(infile, outfile="stdout", decompileFile=True, forceDecompile=False, run=False):
Expand Down Expand Up @@ -97,6 +99,13 @@ def main():
dest='run'
)

parser.add_argument(
'-V',
'--version',
action='version',
version='ti842py {version}'.format(version=__version__)
)

args = parser.parse_args()
transpile(args.infile[0], args.outfile, args.n, args.d, args.run)

Expand Down
9 changes: 1 addition & 8 deletions ti842py/tiParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,7 @@ def convertLine(self, index, line):
self.UTILS["goto"]["enabled"] = True
# Output
elif line.startswith("Output("):
statement = line[7:]
statement = statement.split(",")
if statement[-1].count("\"") > 1:
statement[-1] = "\"" + re.findall('"([^"]*)"', statement[-1])[0] + "\""
elif statement[-1].count("\"") == 1:
statement[-1] = "\"" + statement[-1].strip(" ")[1:] + "\""
statement[-1] = statement[-1].strip(" ")
statement = "output(" + statement[1].strip(" ") + ", " + statement[0].strip(" ") + ", " + statement[-1] + ")"
statement = noStringReplace('Output', 'output', [closeOpen(line)])
self.UTILS["output"]["enabled"] = True
# DS<(
elif line.startswith("DS<("):
Expand Down

0 comments on commit ff0bfae

Please sign in to comment.