From 6630a1a3ee8e65b691bba57ede591b955151439f Mon Sep 17 00:00:00 2001 From: Madpwnhammer Date: Wed, 31 Jul 2024 17:01:07 +0300 Subject: [PATCH] Added: cs_obsolete token --- src/codegen.inc.php | 1 + tpl/codegen_bundle.twig | 1 + tpl/macro.twig | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 98d0dd1..43efa59 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -55,6 +55,7 @@ function supported_tokens() : array 'cs_propget_interface', 'cs_propset_interface', 'cs_propgetset_interface', + 'cs_obsolete', //TODO: //'i18n' ]; diff --git a/tpl/codegen_bundle.twig b/tpl/codegen_bundle.twig index 4a4e8b8..122d1a9 100644 --- a/tpl/codegen_bundle.twig +++ b/tpl/codegen_bundle.twig @@ -1,6 +1,7 @@ //THIS FILE IS GENERATED AUTOMATICALLY, DO NOT TOUCH IT! using System.Collections.Generic; using metagen; +using System; {%- import "macro.twig" as macro -%} diff --git a/tpl/macro.twig b/tpl/macro.twig index d1e65ce..e8bba25 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -188,6 +188,12 @@ ResetFieldMask(); {% endmacro %} {%- macro attributes(o) %} +{% if has_token(o, "cs_obsolete") %} +/// +/// {{token(o, "cs_obsolete")}} +/// +[Obsolete] +{% endif %} {%- if has_token(o, 'cs_attributes') -%} {%- for attr in token(o, 'cs_attributes')|split(',') -%} [{{attr}}]