Skip to content

Commit

Permalink
Logging with escaped sequence (#23)
Browse files Browse the repository at this point in the history
Fix bugs that renders escape sequences when printing matched string
  • Loading branch information
henrylee97 authored Aug 29, 2024
1 parent b45b4a8 commit 4264440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions plare/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ def lex(self, var: str, src: str) -> Generator[Token]:
continue
matched = match.group(0)
logger.debug(
"Pattern, matched: %s (from %s), %s",
regex,
var,
matched,
"Pattern matched: %s (from %s), %s", regex, var, repr(matched)
)
src = src[len(matched) :]
match pattern:
Expand Down
2 changes: 1 addition & 1 deletion plare/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, value: str, *, lineno: int, offset: int) -> None:
logger.debug(
"Token created: %s(%s) @ (%s, %s)",
self.__class__.__name__,
value,
repr(value),
lineno,
offset,
)
Expand Down

0 comments on commit 4264440

Please sign in to comment.