From ef45a217b4ec2b74fef8d77af0d5f58868abb04b Mon Sep 17 00:00:00 2001 From: "Mark S. Baranowski" Date: Sat, 23 Jul 2016 20:56:17 -0600 Subject: [PATCH] Added "ar" prefix for issue #12 --- src/frontend/function_transforms/func_map.py | 16 ++++++++++++++-- .../function_transforms/function_to_lexed.py | 6 ++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/frontend/function_transforms/func_map.py b/src/frontend/function_transforms/func_map.py index 07f95fe..6d3c7a6 100644 --- a/src/frontend/function_transforms/func_map.py +++ b/src/frontend/function_transforms/func_map.py @@ -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 diff --git a/src/frontend/function_transforms/function_to_lexed.py b/src/frontend/function_transforms/function_to_lexed.py index d2d74ea..12ca76b 100644 --- a/src/frontend/function_transforms/function_to_lexed.py +++ b/src/frontend/function_transforms/function_to_lexed.py @@ -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))