Skip to content

Instantly share code, notes, and snippets.

@oprypin

oprypin/_test Secret

Created March 30, 2018 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oprypin/033cf2c8b5e98858f346572d6b614bb0 to your computer and use it in GitHub Desktop.
Save oprypin/033cf2c8b5e98858f346572d6b614bb0 to your computer and use it in GitHub Desktop.
$ crystal tool expand ./actual.cr -c actual.cr:3:1
1 expansion found
expansion 1:
times(5)
# expand macro 'times' (/tmp/lib.cr:1:1)
~> "hi"
"hi"
"hi"
"hi"
"hi"
$ crystal tool expand ./expected.cr -c expected.cr:9:1
1 expansion found
expansion 1:
times
# expand macro 'times' (/tmp/expected.cr:1:1)
~> "hi"
"hi"
"hi"
"hi"
"hi"
require "./lib"
times(5)
macro times
"hi"
"hi"
"hi"
"hi"
"hi"
end
times
macro times(n)
{% for i in 1..n %}
"hi"
{% end %}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment