-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Consider the following example where we'd like to replace
x!
(x + 1)!
by
factorial(x)!
factorial(x + 1)!
Currently, the way to do this would be to process the string until we encounter a !, and then start backtracking workout out the logic.
Suppose we had access to groups of braces, perhaps something like:
braces = {"end_index": "begin_index"}For example, the second case above would be
braces = {4:0}when encoutering a ! at position index, we could simply do something like the following:
if tokens[index-1] == ")":
begin_index = braces[index-1]
tokens[begin_index].string = "factorial("Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels