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

Fix a typo of the context name of asm options #4660

Conversation

makenowjust
Copy link
Contributor

I think this is a failure of copy-and-pasting.

@asterite asterite self-requested a review July 6, 2017 15:34
@@ -4709,7 +4709,7 @@ module Crystal
intel = false
while true
location = @token.location
option = parse_string_without_interpolation("asm clobber")
option = parse_string_without_interpolation("asm option")
Copy link
Contributor

Choose a reason for hiding this comment

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

How about "options" instead of option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which sounds better error message: interpolation not allowed in asm option or interpolation not allowed in asm options? I'm not native speaker, so I don't know.

Copy link
Contributor

@RX14 RX14 Jul 8, 2017

Choose a reason for hiding this comment

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

I'd say the latter, there are multiple options allowed right? so it's plural

Copy link
Contributor Author

Choose a reason for hiding this comment

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

asm("nop" : "in1"(foo1), "in2"(foo2)
          : "out1"(bar1), "out2"(bar2)
          : "clobber1", "clobber2"
          : "volatile", "intel")
#   each of  ^------ and ^---  is an asm option string.

However "volatile, intel" is invalid asm option string. Asm option string can be appeared multiple times with separator, but parse_string_without_interpolation parses only a string literal containing an asm option. I think keeping singular is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I agree in this case that singular sounds right here.

@mverzilli mverzilli merged commit b3c8f87 into crystal-lang:master Jul 9, 2017
@mverzilli
Copy link

Thank you!

@mverzilli mverzilli added this to the Next milestone Jul 9, 2017
@makenowjust makenowjust deleted the fix/crystal/parse-asm-options-string branch July 9, 2017 22:52
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.

None yet

4 participants