From 02085b5b2d16ae8b4d75d85bde97b33a2a19f8a7 Mon Sep 17 00:00:00 2001 From: Kevan Stannard Date: Sun, 9 May 2021 09:02:04 +1000 Subject: [PATCH 1/3] Syntax lookup: Warning decorator --- misc_docs/syntax/decorator_warning.mdx | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 misc_docs/syntax/decorator_warning.mdx diff --git a/misc_docs/syntax/decorator_warning.mdx b/misc_docs/syntax/decorator_warning.mdx new file mode 100644 index 000000000..f0a694851 --- /dev/null +++ b/misc_docs/syntax/decorator_warning.mdx @@ -0,0 +1,30 @@ +--- +id: "warning-decorator" +keywords: ["warning", "decorator"] +name: "@@warning" +summary: "This is the `@@warning` decorator." +category: "decorators" +--- + +The `@@warning` decorator is used to selectively turn compiler warnings on or off. + +### Example + + + +```res +// Turn off warning 44 +@@warning("-44") + +// Turn off warnings 44 and 102 +@@warning("-44-102") +``` + +```js +``` + + + +### References + +* [Build configuration warnings](/docs/manual/latest/build-configuration#warnings) \ No newline at end of file From 3677f4bea10fd0d5429a2a900836b73444d547de Mon Sep 17 00:00:00 2001 From: Kevan Stannard Date: Sat, 15 May 2021 20:23:56 +1000 Subject: [PATCH 2/3] Separate pages for module and expression warnings --- .../syntax/decorator_expression_warning.mdx | 35 +++++++++++++++++++ ...rning.mdx => decorator_module_warning.mdx} | 8 +++-- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 misc_docs/syntax/decorator_expression_warning.mdx rename misc_docs/syntax/{decorator_warning.mdx => decorator_module_warning.mdx} (59%) diff --git a/misc_docs/syntax/decorator_expression_warning.mdx b/misc_docs/syntax/decorator_expression_warning.mdx new file mode 100644 index 000000000..1eb2b4aee --- /dev/null +++ b/misc_docs/syntax/decorator_expression_warning.mdx @@ -0,0 +1,35 @@ +--- +id: "expression-warning-decorator" +keywords: ["warning", "decorator"] +name: "@warning" +summary: "This is the `expression warning` decorator." +category: "decorators" +--- + +The `@warning` decorator is used to selectively enable or disable compiler warnings for _expressions_. + +See the `@@warning` decorator to control warnings for _modules_. + +### Example + + + +```res +// Disable warning 32 (unused value) +@warning("-32") +let result = Ok() +let result = Error() +``` + +```js +var result = { + TAG: /* Error */ 1, + _0: undefined, +}; +``` + + + +### References + +* [Build configuration warnings](/docs/manual/latest/build-configuration#warnings) \ No newline at end of file diff --git a/misc_docs/syntax/decorator_warning.mdx b/misc_docs/syntax/decorator_module_warning.mdx similarity index 59% rename from misc_docs/syntax/decorator_warning.mdx rename to misc_docs/syntax/decorator_module_warning.mdx index f0a694851..ed6145a40 100644 --- a/misc_docs/syntax/decorator_warning.mdx +++ b/misc_docs/syntax/decorator_module_warning.mdx @@ -1,12 +1,14 @@ --- -id: "warning-decorator" +id: "module-warning-decorator" keywords: ["warning", "decorator"] name: "@@warning" -summary: "This is the `@@warning` decorator." +summary: "This is the `module warning` decorator." category: "decorators" --- -The `@@warning` decorator is used to selectively turn compiler warnings on or off. +The `@@warning` decorator is used to selectively enable or disable compiler warnings for _modules_. + +See the `@warning` decorator to control warnings for _expressions_. ### Example From f4dd8ab89ebba1410bc8e2c213c299f3fb1f323d Mon Sep 17 00:00:00 2001 From: Kevan Stannard Date: Sun, 16 May 2021 08:55:44 +1000 Subject: [PATCH 3/3] Tweak summary, add enable example --- misc_docs/syntax/decorator_expression_warning.mdx | 2 +- misc_docs/syntax/decorator_module_warning.mdx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/misc_docs/syntax/decorator_expression_warning.mdx b/misc_docs/syntax/decorator_expression_warning.mdx index 1eb2b4aee..6c9476bf6 100644 --- a/misc_docs/syntax/decorator_expression_warning.mdx +++ b/misc_docs/syntax/decorator_expression_warning.mdx @@ -2,7 +2,7 @@ id: "expression-warning-decorator" keywords: ["warning", "decorator"] name: "@warning" -summary: "This is the `expression warning` decorator." +summary: "This is the `@warning` decorator." category: "decorators" --- diff --git a/misc_docs/syntax/decorator_module_warning.mdx b/misc_docs/syntax/decorator_module_warning.mdx index ed6145a40..43bab945e 100644 --- a/misc_docs/syntax/decorator_module_warning.mdx +++ b/misc_docs/syntax/decorator_module_warning.mdx @@ -2,7 +2,7 @@ id: "module-warning-decorator" keywords: ["warning", "decorator"] name: "@@warning" -summary: "This is the `module warning` decorator." +summary: "This is the `@@warning` decorator." category: "decorators" --- @@ -15,11 +15,11 @@ See the `@warning` decorator to control warnings for _expressions_. ```res -// Turn off warning 44 +// Disable warning 44 @@warning("-44") -// Turn off warnings 44 and 102 -@@warning("-44-102") +// Enable warning 44 and disable warning 102 +@@warning("+44-102") ``` ```js