-
-
Save oprypin/033cf2c8b5e98858f346572d6b614bb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "./lib" | |
times(5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro times | |
"hi" | |
"hi" | |
"hi" | |
"hi" | |
"hi" | |
end | |
times |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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