Skip to content

Commit

Permalink
Merge pull request #215 from gilch/gensym-upgrade
Browse files Browse the repository at this point in the history
Change gensym format
  • Loading branch information
gilch committed May 28, 2023
2 parents 92b210b + 4c205ab commit 4874223
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 501 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 4874223

Please sign in to comment.