Skip to content

Commit

Permalink
Change gensym format
Browse files Browse the repository at this point in the history
  • Loading branch information
gilch committed May 28, 2023
1 parent 92b210b commit fb77b90
Show file tree
Hide file tree
Showing 8 changed files with 563 additions and 500 deletions.
6 changes: 3 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def evaluate(self, example, parser=Lissp()):


def norm_gensym_eq(compiled, python):
"""The special gensym prefix ``_QzNo..._`` will match regardless of number."""
"""The special gensym prefix ``_Qz...z_`` will match regardless of hash."""
return re.fullmatch(
re.sub(r"_QzNo\d+_", r"_QzNo\\d+_", re.escape(python)), compiled
re.sub(r"_Qz[A-Z2-7]+z_", r"_Qz[A-Z2-7]+z_", re.escape(python)), compiled
)


def norm_gensyms(s):
s = re.sub(r"_QzNo\d+_", r"_QzNo000_", s)
s = re.sub(r"_Qz[A-Z2-7]+z_", r"_QzABCDEFGHz_", s)
return indent(s, " " * 2).splitlines(True)


Expand Down
Loading

0 comments on commit fb77b90

Please sign in to comment.