Skip to content

Commit

Permalink
Added "ar" prefix for issue #12
Browse files Browse the repository at this point in the history
  • Loading branch information
keram88 committed Jul 24, 2016
1 parent 82aa7c2 commit ef45a21
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/frontend/function_transforms/func_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
def strip_arc(f):
if f[:3] == "arc":
return "a" + f[3:]
d = {"arccos" : "acos",
"arcos" : "acos",
"arcsin" : "asin",
"arsin" : "asin",
"arctan" : "atan",
"artan" : "atan",
"arccosh" : "acosh",
"arcosh" : "acosh",
"arcsinh" : "asinh",
"arsinh" : "asinh",
"arctanh" : "atanh",
"artanh" : "atanh"}
if f in d.keys():
return d[f]
return f

6 changes: 4 additions & 2 deletions src/frontend/function_transforms/function_to_lexed.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@
t_BINOP = "({})".format(")|(".join(BINOPS))

UNIOPS = {"abs", "cos", "exp", "log", "sin", "tan", "sqrt",
"arccos", "arcsin", "arctan", "acos", "asin", "atan",
"arccos", "arcsin", "arctan", "arcos", "arsin", "artan",
"acos", "asin", "atan",
"sinh", "cosh", "tanh",
"arccosh", "arcsinh", "arctanh", "acosh", "asinh", "atanh"}
"arccosh", "arcsinh", "arctanh", "arcosh", "arsinh", "artanh",
"acosh", "asinh", "atanh"}

t_UNIOP = "({})".format(")|(".join(UNIOPS))

Expand Down

0 comments on commit ef45a21

Please sign in to comment.