Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Blacksmoke16 committed Dec 21, 2023
1 parent a40ceb9 commit 86593bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/syntax_and_semantics/macros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ Foo.boo(0, 1)
## Call Information

When a macro is called, you can access the macro call stack with a special instance variable: `@caller`.
This variable returns an `ArrayLiteral` of [`Call`](https://crystal-lang.org/api/Crystal/Macros/Call.html) nodes with the first element in the array being the most recent,
unless it is called outside of a macro in which case it's a [`NilLiteral`](https://crystal-lang.org/api/Crystal/Macros/NilLiteral.html).
This variable returns an `ArrayLiteral` of [`Call`](https://crystal-lang.org/api/Crystal/Macros/Call.html) nodes with the first element in the array being the most recent.
Outside of a macro or if the macro has no caller (e.g. a [hook](#hook)) the value is a [`NilLiteral`](https://crystal-lang.org/api/Crystal/Macros/NilLiteral.html).

NOTE: As of now, the returned array will always only have a single element.

Expand Down Expand Up @@ -473,7 +473,7 @@ Notice the variables in the inner macro are not available within the `verbatim`

## Comments

Macro expressions are evaluated both within comments as well as compatible sections of code. This may be used to provide relevant documentation for expansions:
Macro expressions are evaluated both within comments as well as compilable sections of code. This may be used to provide relevant documentation for expansions:

```crystal
{% for name, index in ["foo", "bar", "baz"] %}
Expand Down Expand Up @@ -518,9 +518,9 @@ gen_method foo
When generated, the docs for the `#foo` method would be like:

```text
# Comment on macro call.
#
# Comment added via macro expansion.
Comment on macro call.
Comment added via macro expansion.
```

## Pitfalls
Expand Down

0 comments on commit 86593bb

Please sign in to comment.