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

dotc settings: String options after settings with colon shouldn't be ignored #1180

Merged
merged 1 commit into from
Mar 22, 2016

Conversation

niktrop
Copy link
Contributor

@niktrop niktrop commented Mar 17, 2016

Format of some of the compiler settings is incompatible with scalac. For example "-target:jvm-1.8" is a valid argument for scalac, but it should be "-target: jvm-1.8" (with a whitespace) for dotc. This commit make both ways to work.

@sjrd
Copy link
Member

sjrd commented Mar 17, 2016

I suspect that expecting a space was a bug in the first place. I would suggest disallowing the variant with the space, but maybe wait for someone else to confirm.

@odersky
Copy link
Contributor

odersky commented Mar 17, 2016

Yes, we should not accept a space here.

On Thu, Mar 17, 2016 at 10:47 AM, Sébastien Doeraene <
[email protected]> wrote:

I suspect that expecting a space was a bug in the first place. I would
suggest disallowing the variant with the space, but maybe wait for someone
else to confirm.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#1180 (comment)

Martin Odersky
EPFL

@niktrop
Copy link
Contributor Author

niktrop commented Mar 18, 2016

I have added a check for non-empty argument without whitespace for such settings.

case (StringTag, _) =>
if (argRest.isEmpty && args.isEmpty) missingArg
else {
val (arg, tail) = if (argRest.isEmpty) (args.head, args.tail) else (argRest, args)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should simplify here and not accept a following argument. I suspect then the whole thing will be shorter (which is what we want).

…without whitespace

Format of some of the compiler settings was incompatible with scalac. For example "-target:jvm-1.8" is a valid argument for scalac, but it should be "-target: jvm-1.8" (with a whitespace) for dotc.
@niktrop niktrop force-pushed the dotc-settings-format branch from 145c5e2 to 5ff8649 Compare March 18, 2016 14:25
@niktrop
Copy link
Contributor Author

niktrop commented Mar 18, 2016

It seems that only ChoiceSettings should behave like Multistring. Other StringSettings don't require colon. I force-pushed simplified version.

@odersky
Copy link
Contributor

odersky commented Mar 22, 2016

LGTM, thanks!

DarkDimius added a commit that referenced this pull request Mar 22, 2016
dotc settings: String options after settings with colon shouldn't be ignored
@DarkDimius DarkDimius merged commit 3e43c7f into scala:master Mar 22, 2016
@smarter smarter mentioned this pull request Jun 2, 2016
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.

5 participants