Skip to content

Conversation

@ChingLongTin
Copy link

This is a draft PR to implement the staged keyword and :staging compiler flag.

This currently cannot merge due to the change in semantics.Import syntax in MLsCompiler.scala.

Adding the staged: Bool field into FunDefn is a bit hacky to avoid rewriting existing match statements, we'll look into adding the field to ClsLikeBody instead.

@LPTK
Copy link
Contributor

LPTK commented Nov 1, 2025

There is no need to add such a field to ClsLikeBody. You can simply access the source definition through the symbol's defn field and find there whether the staged annotation is present.

@ChingLongTin
Copy link
Author

ChingLongTin commented Nov 4, 2025

You're right, I've updated the implementation to use that instead. Now I have 2 diff tests failing:

  • ParseRuleVisualizerTest
  • RenderingTest

val liftDefns = NullaryCommand("lift")
val importQQ = NullaryCommand("qq")
val staging = NullaryCommand("staging")
val stageCode = NullaryCommand("ds")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the command named "ds"? I would expect this shorthand to mean "debug staging".

Copy link
Author

Choose a reason for hiding this comment

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

It was short for "dynamic staging". Would ":staging" be a better name for the command?

//│ rhs = N

// TODO: reject these annotations?
:pt
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't commit these trees. They're pure noise. Keep at most one representative :pt.

@LPTK
Copy link
Contributor

LPTK commented Nov 5, 2025

Now I have 2 diff tests failing

Please elaborate; this doesn't help. Why are they failing?

Also, please fix the conflicts.

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.

3 participants