Skip to content

Commit

Permalink
Merge pull request #73 from Rudxain/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
SatinWukerORIG authored Mar 14, 2024
2 parents 45f7bdf + 065b38b commit 6b49e13
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions src/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,11 @@ def remove_all(l: list, x):
return l

def filter_str(s:str):
res = ""
i = 1
while i < len(s) - 1:
if s[i] == '\\':
if s[i + 1] == 'n':
res += '\n'
i += 1
else:
res += s[i]
i += 1
return res

# filter_str: Final[Callable[[str], str]] = lambda s: s[1:-1]
"""Remove 1st and last chars from a `str`."""

"""
Remove 1st and last chars, and
replace line-feed literals with actual line-feeds.
"""
return s[1:-1].replace("\\n", "\n")

def precedence(op: str):
"""
Expand Down

0 comments on commit 6b49e13

Please sign in to comment.