Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naïve compilation of refining patterns #242

Merged
merged 13 commits into from
Dec 3, 2024
Merged

Conversation

chengluyu
Copy link
Member

No description provided.

Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature! I just have a few minor comments for now. Please address them first.

Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the nice work! But there are still some things to address.

case S(cls: (ClassSymbol | ModuleSymbol)) =>
raise(ErrorReport(msg"Cannot match ${ctor.describe} as a string prefix" -> ctor.toLoc :: Nil))
val kind = cls match { case _: ClassSymbol => "class" case _ => "module" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should rather use cls.tree.k.

Copy link
Member Author

@chengluyu chengluyu Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. There is a small problem, tree is a val defined on both ClassSymbol and ModuleSymbol independently (no base class has such a field), so I can't simply access it with cls.tree. Do you have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I think you can just declare an abstract val in MemberSymbol.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, I need to implement tree: Tree in BlockMemberSymbol, TermSymbol, TypeAliasSymbol, and TopLevelSymbol. Sorry, I need more guidance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok forget it for now.

hkmc2/shared/src/main/scala/hkmc2/semantics/Symbol.scala Outdated Show resolved Hide resolved
@LPTK LPTK merged commit 9986302 into hkust-taco:hkmc2 Dec 3, 2024
1 check passed
@LPTK LPTK deleted the hkmc2-ucs2 branch December 3, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants