Skip to content

Commit

Permalink
fix matrix inititalization syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
TabulateJarl8 committed Jul 20, 2021
1 parent 4555b04 commit 8b984ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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.9.1"
__version__ = "0.9.2"
__author__ = "Tabulate"
__author_email__ = "[email protected]"
__license__ = "GPLv3"
Expand Down
2 changes: 1 addition & 1 deletion ti842py/tiParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def convertLine(self, index, line):
statement = parsing_utils.noStringReplace(r'\[([A-J])\]', r'matrix_\1', statement)
statement = parsing_utils.noStringReplace(r'(matrix_[A-J])\((.+),(.+?)\)', lambda m: m.group(1) + '[' + m.group(2) + ' - 1][' + m.group(3) + ' - 1]', statement)
statement = parsing_utils.noStringReplace(r'len\((matrix_[A-J])\)\s*=\s*\[(.+),(.+?)\]', r'\1.reshape(\2, \3)', statement)
statement = parsing_utils.noStringReplace(r'(matrix_[A-J])\s*=\s*(\[\[.*\]\])', r'\1 = Matrix(\2)', statement)
statement = parsing_utils.noStringReplace(r'(matrix_[A-J])\s*=\s*(\[\[.*\]\])', lambda m: m.group(1) + ' = Matrix(' + m.group(2).replace('][', '], [') + ')', statement)
self.UTILS['matrix']['enabled'] = True

if 'int(' in ' '.join(statement):
Expand Down

0 comments on commit 8b984ac

Please sign in to comment.