From ff0bfae84a7a051efd611bd1c9de66b44137e4ec Mon Sep 17 00:00:00 2001 From: TabulateJarl8 Date: Fri, 21 May 2021 09:20:49 -0400 Subject: [PATCH] fix ouput --- ti842py/__version__.py | 2 +- ti842py/main.py | 9 +++++++++ ti842py/tiParser.py | 9 +-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ti842py/__version__.py b/ti842py/__version__.py index e669622..9b7aa12 100644 --- a/ti842py/__version__.py +++ b/ti842py/__version__.py @@ -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__ = "tabulatejarl8@gmail.com" __license__ = "GPLv3" diff --git a/ti842py/main.py b/ti842py/main.py index 609d505..8ab8b56 100644 --- a/ti842py/main.py +++ b/ti842py/main.py @@ -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): @@ -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) diff --git a/ti842py/tiParser.py b/ti842py/tiParser.py index 80691ea..642f0af 100644 --- a/ti842py/tiParser.py +++ b/ti842py/tiParser.py @@ -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<("):