- added ability to specify deprecation messages in ZScript

It's an optional extension of deprecated keyword:
    deprecated("2.4", "use ModernFunction instead") int OldFunction();
    deprecated("3.5", "use ModernVariable instead") int OldVariable;

Usage of such members will produce the following report:
    Script warning, ":zscript.txt" line 123:
    Accessing deprecated function OldFunction - deprecated since 2.4.0, use ModernFunction instead
    Script warning, ":zscript.txt" line 456:
    Accessing deprecated member variable OldVariable - deprecated since 3.5.0, use ModernVariable instead
This commit is contained in:
alexey.lysiuk 2019-08-28 13:04:13 +03:00 committed by Christoph Oelckers
commit 98128d9fa3
5 changed files with 49 additions and 15 deletions

View file

@ -515,6 +515,7 @@ struct ZCC_FuncParamDecl : ZCC_TreeNode
struct ZCC_DeclFlags : ZCC_TreeNode
{
ZCC_Identifier *Id;
FString *DeprecationMessage;
VersionInfo Version;
int Flags;
};
@ -537,6 +538,7 @@ struct ZCC_Declarator : ZCC_TreeNode
struct ZCC_VarDeclarator : ZCC_Declarator
{
ZCC_VarName *Names;
FString *DeprecationMessage;
};
// A function in a class.
@ -546,6 +548,7 @@ struct ZCC_FuncDeclarator : ZCC_Declarator
ENamedName Name;
ZCC_Statement *Body;
ZCC_Identifier *UseFlags;
FString *DeprecationMessage;
};
struct ZCC_Default : ZCC_CompoundStmt