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

Rename skip() macro method to skip_file() #4709

Merged
merged 1 commit into from
Jul 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions spec/compiler/semantic/macro_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -989,13 +989,13 @@ describe "Semantic: macro" do
)) { int32 }
end

describe "skip macro directive" do
describe "skip_file macro directive" do
it "skips expanding the rest of the current file" do
res = semantic(%(
class A
end

{% skip() %}
{% skip_file() %}

class B
end
Expand All @@ -1012,7 +1012,7 @@ describe "Semantic: macro" do

{% if true %}
class C; end
{% skip() %}
{% skip_file() %}
class D; end
{% end %}

Expand Down
6 changes: 3 additions & 3 deletions src/compiler/crystal/macros/methods.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module Crystal
interpret_puts(node)
when "pp"
interpret_pp(node)
when "skip"
interpret_skip(node)
when "skip_file"
interpret_skip_file(node)
when "system", "`"
interpret_system(node)
when "raise"
Expand Down Expand Up @@ -133,7 +133,7 @@ module Crystal
@last = Nop.new
end

def interpret_skip(node)
def interpret_skip_file(node)
raise SkipMacroException.new(@str.to_s)
end

Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/arc4random.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:openbsd) %}
{% skip_file() unless flag?(:openbsd) %}

require "c/stdlib"

Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/getrandom.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:linux) %}
{% skip_file() unless flag?(:linux) %}

require "c/unistd"
require "c/sys/syscall"
Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/sysconf_cpucount.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file if flag?(:openbsd) || flag?(:freebsd) %}
{% skip_file() if flag?(:openbsd) || flag?(:freebsd) %}

require "c/unistd"

Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/sysctl_cpucount.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% skip_file unless flag?(:openbsd) || flag?(:freebsd) %}
{% skip_file() unless flag?(:openbsd) || flag?(:freebsd) %}

require "c/sysctl"

Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/urandom.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: replace with `flag?(:unix) && !flag?(:openbsd) && !flag?(:linux)` after crystal > 0.22.0 is released
{% skip_file if flag?(:openbsd) && flag?(:linux) %}
{% skip_file() if flag?(:openbsd) && flag?(:linux) %}

module Crystal::System::Random
@@initialized = false
Expand Down