Skip to content

Commit

Permalink
Document Crystal::Macros::MagicConstant
Browse files Browse the repository at this point in the history
  • Loading branch information
HertzDevil committed Dec 7, 2023
1 parent 413f2fd commit a8c2684
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/compiler/crystal/macros.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1931,8 +1931,20 @@ module Crystal::Macros
class Underscore < ASTNode
end

# class MagicConstant < ASTNode
# A pseudo constant used to provide information about source code location.
#
# Usually this node is resolved by the compiler. It appears unresolved when
# used as a default parameter value:
#
# ```
# # the `__FILE__` here is a `MagicConstant` node
# def foo(file = __FILE__)
# # the `__LINE__` here becomes a `NumberLiteral`
# __LINE__
# end
# ```
class MagicConstant < ASTNode
end

# A fictitious node representing an identifier like, `foo`, `Bar` or `something_else`.
#
Expand Down

0 comments on commit a8c2684

Please sign in to comment.