aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-03 06:59:22 +0000
committerGravatar jesopo2020-01-03 06:59:22 +0000
commite9f82fc6450a40b55bcfb1d8f55e0d00ac03f703 (patch)
treea2c8ded30be1fc921e7a378bd4433fe0485286e6 /src
parentreword karma to "<target> now has 3 karma (1 from <sender>)" (diff)
signature
sort variable $names descending so longer ones are caught first
Diffstat (limited to 'src')
-rw-r--r--src/utils/parse.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/parse.py b/src/utils/parse.py
index fe26d7aa..c0740785 100644
--- a/src/utils/parse.py
+++ b/src/utils/parse.py
@@ -122,6 +122,10 @@ def timed_args(args, min_args):
def format_tokens(s: str, names: typing.List[str], sigil: str="$"
) -> typing.List[typing.Tuple[int, str]]:
+ names = names.copy()
+ names.sort()
+ names.reverse()
+
i = 0
max = len(s)-1
sigil_found = False