cross-compile codegen module against scala3#1717
cross-compile codegen module against scala3#1717ghostbuster91 wants to merge 6 commits intodisneystreaming:series/0.18from
Conversation
| import scala.reflect.runtime.universe._ | ||
| val str = Literal(Constant(raw)) | ||
| .toString() | ||
| // Escape the string as a Scala literal (surround with quotes, escape special characters) |
There was a problem hiding this comment.
homestly I think we should just use scalameta for small things like these (rendering constants)
There was a problem hiding this comment.
fine, if you want to pull it I don't mind. But don't get your hopes up about rewriting the codegen in scalameta
There was a problem hiding this comment.
I tried it in the past and while having the snippets to compile at the same time you compile your code is mind-blowing there was a lot of hassle sometimes to get them right.
There was a problem hiding this comment.
yeah, the ancestor to smithy4s was actually written with scalameta. Lots of friction.
There was a problem hiding this comment.
hints:
libraryDependencies += ("org.scalameta" %% "scalameta" % "4.11.0").cross(CrossVersion.for3Use2_13)scala.meta.Lit.String(s).printSyntaxFor(scala.meta.dialects.Scala3)
that's how I use it in https://github.com/kubukoz/smithy-playground/blob/c34be16f534795041295f4379a6ca8040297c4b1/modules/parser-gen/src/main/scala/playground/parsergen/ParserGen.scala#L355C25-L355C92 anyway
|
we'll need this for #1790. @ghostbuster91 how do you feel about finishing this up? |
|
Sounds like a good case. I will try to do this this week. |
PR Checklist (not all items are relevant to all PRs)