diff --git a/python/builtins.py b/python/builtins.py index 1f096cc1..9528160b 100644 --- a/python/builtins.py +++ b/python/builtins.py @@ -96,77 +96,94 @@ def sorted(iterable, reverse=False, key=None): return a ##### str ##### -def tokenize(s:str) -> list: - tokens = [] - L, R = 0,0 - - mode = None - curPos = 0 - lookingForKword = False - - while(R str: - tokens = tokenize(self) + def tokenizeString(s:str): + tokens = [] + L, R = 0,0 + + mode = None + curArg = 0 + # lookingForKword = False + + while(R str: key = t[1:-1] argMapVal = argMap.get(key, None) kwargsVal = kwargs.get(key, None) - + if argMapVal is None and kwargsVal is None: raise ValueError("No arg found for token: "+t) elif argMapVal is not None: @@ -187,7 +204,7 @@ def __f(self:str, *args, **kwargs) -> str: final_tokens.append(t) return ''.join(final_tokens) - + # if '{}' in self: # for i in range(len(args)): # self = self.replace('{}', str(args[i]), 1)