Skip to content

Commit

Permalink
Fix minor
Browse files Browse the repository at this point in the history
  • Loading branch information
belerico committed Apr 19, 2020
1 parent f827e7c commit 4208b43
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions py_asciimath/transformer/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ..translation.latex2asciimath import smb as l2mml_smb
from ..translation.latex2asciimath import unary_functions as l2mml_una
from ..utils.log import Log
from ..utils.utils import UtilsMat, concat, encapsulate_mrow
from ..utils.utils import UtilsMat, encapsulate_mrow

# standard_library.install_aliases()
logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG)
Expand Down Expand Up @@ -335,7 +335,7 @@ def exp_binary(self, items):
def symbol(self, items):
if items[0] in colors:
return items[0]
elif items[0] == '\\':
elif items[0] == "\\":
return "<mo>&setminus;</mo>"
else:
return "<mo>" + mathml_smb[items[0]] + "</mo>"
Expand Down Expand Up @@ -435,20 +435,18 @@ def const(self, items):
def q_str(self, items):
return items

@log
def exp_mat(self, items):
def _get_row(self, items, sep="&"):
s = ""
for i in items:
if i == "\\\\":
if i == sep:
i = ","
s = s + i
return "[" + s + "]"

@log
def exp_mat(self, items):
return self._get_row(items, sep="\\\\")

@log
def row_mat(self, items):
s = ""
for i in items:
if i == "&":
i = ","
s = s + i
return "[" + s + "]"
return self._get_row(items, sep="&")

0 comments on commit 4208b43

Please sign in to comment.