Skip to content

Commit

Permalink
Reintroduce old code
Browse files Browse the repository at this point in the history
While I finished Salve v1.0.0 I needed this different to fix some tests but now that it works slightly different I can reintroduce this
  • Loading branch information
Moosems committed Jul 26, 2024
1 parent 27b6f82 commit ae9e0fd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions token_tools/token_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def merge_tokens(tokens: list[Token]) -> list[Token]:
)
output_tokens[-1] = new_token

output_tokens = sorted(set(output_tokens))
return output_tokens


Expand Down Expand Up @@ -168,8 +169,8 @@ def overwrite_and_merge_tokens(
old_tokens: list[Token], new_tokens: list[Token]
) -> list[Token]:
"""Given a list of old Token's and new Token's, it will merge both lists, overwrite old overlapping Token's and then merge the final result"""
merged_old_tokens: list[Token] = sorted(set(merge_tokens(old_tokens)))
merged_new_tokens: list[Token] = sorted(set(merge_tokens(new_tokens)))
merged_old_tokens: list[Token] = merge_tokens(old_tokens)
merged_new_tokens: list[Token] = merge_tokens(new_tokens)
output_tokens: list[Token] = overwrite_tokens(
merged_old_tokens, merged_new_tokens
)
Expand Down

0 comments on commit ae9e0fd

Please sign in to comment.