diff options
| author | 2020-01-25 11:32:01 +0000 | |
|---|---|---|
| committer | 2020-01-25 11:32:01 +0000 | |
| commit | 5722a567a102454f7b4d1c1c178424eaf228836e (patch) | |
| tree | c7cee4de62e52df1e2097b8599220386b7d4ee9b /src/utils | |
| parent | update mode list functions to not use `args` (diff) | |
| signature | ||
fix format_token_replace for $$
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/parse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/parse.py b/src/utils/parse.py index fb12b9c1..b45ca6fe 100644 --- a/src/utils/parse.py +++ b/src/utils/parse.py @@ -141,14 +141,14 @@ def format_tokens(s: str, names: typing.List[str], sigil: str="$" i += len(name) break else: - tokens.append((i, "$")) + tokens.append((i-1, "$$")) i += 1 return tokens def format_token_replace(s: str, vars: typing.Dict[str, str], sigil: str="$") -> str: vars = vars.copy() - vars.update({"": ""}) + vars.update({sigil: sigil}) tokens = format_tokens(s, list(vars.keys()), sigil) tokens.sort(key=lambda x: x[0]) tokens.reverse() |
