Skip to content

Commit

Permalink
Remove unneeded parenthesis from calls in macro expression (#5493)
Browse files Browse the repository at this point in the history
* Remove parenthesis from macro calls without arguments: not needed anymore as of 0.24.0

* Resolve TODO in urandom
  • Loading branch information
straight-shoota authored and RX14 committed Jan 20, 2018
1 parent a288123 commit 3515968
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions spec/compiler/semantic/macro_spec.cr
Expand Up @@ -1049,7 +1049,7 @@ describe "Semantic: macro" do
class A
end
{% skip_file() %}
{% skip_file %}
class B
end
Expand All @@ -1066,7 +1066,7 @@ describe "Semantic: macro" do
{% if true %}
class C; end
{% skip_file() %}
{% skip_file %}
class D; end
{% end %}
Expand Down
2 changes: 1 addition & 1 deletion src/callstack.cr
@@ -1,4 +1,4 @@
{% skip_file() if flag?(:win32) %}
{% skip_file if flag?(:win32) %}

require "c/dlfcn"
require "c/stdio"
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/macros/interpreter.cr
Expand Up @@ -77,7 +77,7 @@ module Crystal
@scope : Type, @path_lookup : Type, @location : Location?,
@vars = {} of String => ASTNode, @block : Block? = nil, @def : Def? = nil,
@in_macro = false)
@str = IO::Memory.new(512) # Can't be String::Builder because of `{{debug()}}
@str = IO::Memory.new(512) # Can't be String::Builder because of `{{debug}}`
@last = Nop.new
end

Expand Down
2 changes: 1 addition & 1 deletion src/crystal/system/unix/arc4random.cr
@@ -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
@@ -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
@@ -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
@@ -1,4 +1,4 @@
{% skip_file() unless flag?(:openbsd) || flag?(:freebsd) %}
{% skip_file unless flag?(:openbsd) || flag?(:freebsd) %}

require "c/sysctl"

Expand Down
3 changes: 1 addition & 2 deletions src/crystal/system/unix/urandom.cr
@@ -1,5 +1,4 @@
# 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 unless flag?(:unix) && !flag?(:openbsd) && !flag?(:linux) %}

module Crystal::System::Random
@@initialized = false
Expand Down
2 changes: 1 addition & 1 deletion src/io/console.cr
@@ -1,4 +1,4 @@
{% skip_file() if flag?(:win32) %}
{% skip_file if flag?(:win32) %}

require "termios"

Expand Down
2 changes: 1 addition & 1 deletion src/io/encoding.cr
Expand Up @@ -15,7 +15,7 @@ class IO
end
end

{% skip_file() if flag?(:win32) %}
{% skip_file if flag?(:win32) %}

private class Encoder
def initialize(@encoding_options : EncodingOptions)
Expand Down
2 changes: 1 addition & 1 deletion src/io/syscall.cr
@@ -1,4 +1,4 @@
{% skip_file() if flag?(:win32) %}
{% skip_file if flag?(:win32) %}

module IO::Syscall
@read_timed_out = false
Expand Down

0 comments on commit 3515968

Please sign in to comment.