From eb325dc0d89e09214e0135a3ce1f8ad48a88c61a Mon Sep 17 00:00:00 2001 From: "Brian J. Cardiff" Date: Mon, 8 Apr 2019 16:45:21 -0300 Subject: [PATCH] Add Deprecated annotation to prelude and docs --- src/annotations.cr | 11 +++++++++++ src/docs_main.cr | 1 + src/prelude.cr | 1 + 3 files changed, 13 insertions(+) create mode 100644 src/annotations.cr diff --git a/src/annotations.cr b/src/annotations.cr new file mode 100644 index 000000000000..cf50ab2857a5 --- /dev/null +++ b/src/annotations.cr @@ -0,0 +1,11 @@ +# This annotations marks methods as deprecated. +# +# It receives an optional `StringLiteral` as single argument containing a deprecation notice. +# +# ``` +# @[Deprecated("Use #bar instead")] +# def foo +# end +# ``` +annotation Deprecated +end diff --git a/src/docs_main.cr b/src/docs_main.cr index fc1316930508..33fab58cd97e 100644 --- a/src/docs_main.cr +++ b/src/docs_main.cr @@ -2,6 +2,7 @@ # It, for example, doesn't include API for the compiler, but does include # the fictitious API for the Crystal::Macros module. +require "./annotations" require "./big" require "./compiler/crystal/macros" require "./crypto/**" diff --git a/src/prelude.cr b/src/prelude.cr index e69aa53e3536..777b85adb520 100644 --- a/src/prelude.cr +++ b/src/prelude.cr @@ -28,6 +28,7 @@ require "indexable" require "string" # Alpha-sorted list +require "annotations" require "array" require "atomic" require "bool"