sort variable $names descending so longer ones are caught first
This commit is contained in:
parent
82ba7a0922
commit
e9f82fc645
1 changed files with 4 additions and 0 deletions
|
@ -122,6 +122,10 @@ def timed_args(args, min_args):
|
||||||
|
|
||||||
def format_tokens(s: str, names: typing.List[str], sigil: str="$"
|
def format_tokens(s: str, names: typing.List[str], sigil: str="$"
|
||||||
) -> typing.List[typing.Tuple[int, str]]:
|
) -> typing.List[typing.Tuple[int, str]]:
|
||||||
|
names = names.copy()
|
||||||
|
names.sort()
|
||||||
|
names.reverse()
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
max = len(s)-1
|
max = len(s)-1
|
||||||
sigil_found = False
|
sigil_found = False
|
||||||
|
|
Loading…
Reference in a new issue