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

skip_file macro replaced with skip macro. #4686

Conversation

akzhan
Copy link
Contributor

@akzhan akzhan commented Jul 7, 2017

@@ -1,4 +1,4 @@
{% skip_file unless flag?(:openbsd) %}
{% skip() unless flag?(:openbsd) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it require the empty call args?

Copy link
Contributor Author

@akzhan akzhan Jul 7, 2017

Choose a reason for hiding this comment

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

I'm unsure but skip macro is tested and documented with ().

Will check now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

() are required due to

  1) Semantic: macro skip macro directive skips expanding the rest of the current file

       Error in line 6: expanding macro

       in line 6: undefined macro variable 'skip'

@ysbaddaden
Copy link
Contributor

Why?

@akzhan
Copy link
Contributor Author

akzhan commented Jul 7, 2017

@ysbaddaden Current codebase fail on bin/crystal doc, see discussion started with #4675 (comment)

➜  crystal git:(master) ✗  LLVM_CONFIG=llvm-config-4.0 bin/crystal doc
Using compiled compiler at `.build/crystal'
Error in line 1: while requiring "./src/**"

in src/crystal/system/unix/arc4random.cr:1: expanding macro

{% skip_file unless flag?(:openbsd) %}
^

in src/crystal/system/unix/arc4random.cr:1: undefined macro variable 'skip_file'

{% skip_file unless flag?(:openbsd) %}
   ^~~~~~~~~

@straight-shoota
Copy link
Member

straight-shoota commented Jul 7, 2017

Wouldn't it make more sense to rename everything to skip_file? That's more descriptive of what happens

@akzhan
Copy link
Contributor Author

akzhan commented Jul 7, 2017

/cc @mverzilli

@ysbaddaden
Copy link
Contributor

Thanks. Always link or copy-paste explanations. We do not necessarily notice buried comments.

Keep skip_file() with forced parens, so it's obvious to the compiler that it's a method call. This macro name is more descriptive than a clueless skip.

@mverzilli
Copy link

skip_file was the original name, then we decided to change it to skip (skip_file only existed for a couple of days in master). I guess in the meantime we merged the code @akzhan is trying to fix now.

I see your point that skip_file is more descriptive than skip, and given it's not going to be a very commonly used feature, more clarity is well worth the extra keystrokes.

So I'd suggest that we closed this PR and opened another one renaming skip to skip_file.

@akzhan
Copy link
Contributor Author

akzhan commented Jul 8, 2017

It's time to prefer skip_file.

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

5 participants