Skip to content

Commit

Permalink
Fix documentation for macros system and run (#11740)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbguilherme authored Jan 29, 2022
1 parent 06f8858 commit 773d707
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/compiler/crystal/macros.cr
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ module Crystal::Macros
def `(command) : MacroId
end

# :ditto:
# Executes a system command and returns the output as a `MacroId`.
# Gives a compile-time error if the command failed to execute.
#
# ```
# {{ system("echo hi") }} # => "hi\n"
# ```
def system(command) : MacroId
end

Expand Down Expand Up @@ -252,8 +257,8 @@ module Crystal::Macros
#
# The file denoted by *filename* must be a valid Crystal program.
# This macro invocation passes *args* to the program as regular
# program arguments. The program must output a valid Crystal expression.
# This output is the result of this macro invocation, as a `MacroId`.
# program arguments. This output is the result of this macro invocation,
# as a `MacroId`.
#
# The `run` macro is useful when the subset of available macro methods
# are not enough for your purposes and you need something more powerful.
Expand Down

0 comments on commit 773d707

Please sign in to comment.