Skip to content

Fix #3914: Add compiler args to quote run and show Settings #3972

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

Merged
merged 2 commits into from
Feb 12, 2018

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki
Copy link
Contributor Author

This will be useful for debugging.

Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM

val ctx: Context = initCtx.fresh
ctx.settings.optimise.update(settings.optimise)(ctx)
def run[T](expr: Expr[T], settings: Settings[Run]): T = {
val (_, ctx: Context) = setup(settings.compilerArgs.toArray :+ "dummy.scala", initCtx.fresh)
Copy link
Contributor

Choose a reason for hiding this comment

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

dummy.scala?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setup expects some input file. But it is not required here. Hence I add a dummy file name that is then ignored. It is the _ in val (_, ctx: Context) =

val ctx: Context = initCtx.fresh
ctx.settings.color.update("never")(ctx) // TODO support colored show
def withTree[T](expr: Expr[_], f: (Tree, Context) => T, settings: Settings[_]): T = {
val (_, ctx: Context) = setup(settings.compilerArgs.toArray :+ "dummy.scala", initCtx.fresh)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's dummy.scala?

@nicolasstucki nicolasstucki merged commit 3b5419d into scala:master Feb 12, 2018
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