Skip to content

Commit

Permalink
feat(compiler): use filename_line number instead of _ for block state…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
nau committed May 1, 2024
1 parent 6b1e8ca commit b99f3b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scalus-plugin/src/main/scala/scalus/SIRCompiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,15 @@ final class SIRCompiler(mode: scalus.Mode)(using ctx: Context) {
stmt match
case vd: ValDef => compileValDef(env, vd)
case dd: DefDef => compileDefDef(env, dd, isGlobalDef)
case x => Some(B("_", NoSymbol, Recursivity.NonRec, compileExpr(env, x)))
case x =>
Some(
B(
s"__${stmt.source.file.name.takeWhile(_.isLetterOrDigit)}_line_${stmt.srcPos.line}",
NoSymbol,
Recursivity.NonRec,
compileExpr(env, x)
)
)
}

private def compileBlock(env: Env, stmts: immutable.List[Tree], expr: Tree): SIR = {
Expand Down

0 comments on commit b99f3b1

Please sign in to comment.