mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
Renamed 'allowui' to 'clearscope'. 'allowui' doesn't reflect the real meaning of the keyword which clears implicit 'play' or 'ui' inherited from parent class (for classes) or owning type (for methods/fields)
This commit is contained in:
parent
2b20abff02
commit
0f031c5f22
7 changed files with 20 additions and 20 deletions
|
@ -173,7 +173,7 @@ std2:
|
||||||
'nonew' { RET(TK_NoNew); }
|
'nonew' { RET(TK_NoNew); }
|
||||||
'ui' { RET(TK_UI); }
|
'ui' { RET(TK_UI); }
|
||||||
'play' { RET(TK_Play); }
|
'play' { RET(TK_Play); }
|
||||||
'allowui' { RET(TK_AllowUI); }
|
'clearscope' { RET(TK_ClearScope); }
|
||||||
'super' { RET(TK_Super); }
|
'super' { RET(TK_Super); }
|
||||||
'global' { RET(TK_Global); }
|
'global' { RET(TK_Global); }
|
||||||
'stop' { RET(TK_Stop); }
|
'stop' { RET(TK_Stop); }
|
||||||
|
|
|
@ -115,7 +115,7 @@ xx(TK_VarArg, "'vararg'")
|
||||||
xx(TK_NoNew, "'nonew'")
|
xx(TK_NoNew, "'nonew'")
|
||||||
xx(TK_UI, "'ui'")
|
xx(TK_UI, "'ui'")
|
||||||
xx(TK_Play, "'play'")
|
xx(TK_Play, "'play'")
|
||||||
xx(TK_AllowUI, "'allowui'")
|
xx(TK_ClearScope, "'clearscope'")
|
||||||
xx(TK_Override, "'override'")
|
xx(TK_Override, "'override'")
|
||||||
xx(TK_Super, "'super'")
|
xx(TK_Super, "'super'")
|
||||||
xx(TK_Null, "'null'")
|
xx(TK_Null, "'null'")
|
||||||
|
|
|
@ -71,7 +71,7 @@ class FxLocalVariableDeclaration;
|
||||||
typedef TDeletingArray<FxExpression*> FArgumentList;
|
typedef TDeletingArray<FxExpression*> FArgumentList;
|
||||||
|
|
||||||
// [ZZ] this is kind of related to compile context as well
|
// [ZZ] this is kind of related to compile context as well
|
||||||
struct FPlayUIBarrier
|
struct FScopeBarrier
|
||||||
{
|
{
|
||||||
bool callable;
|
bool callable;
|
||||||
bool readable;
|
bool readable;
|
||||||
|
@ -118,7 +118,7 @@ struct FPlayUIBarrier
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FPlayUIBarrier()
|
FScopeBarrier()
|
||||||
{
|
{
|
||||||
sidefrom = -1;
|
sidefrom = -1;
|
||||||
sidelast = -1;
|
sidelast = -1;
|
||||||
|
@ -127,7 +127,7 @@ struct FPlayUIBarrier
|
||||||
writable = true;
|
writable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FPlayUIBarrier(int flags1, int flags2, const char* name)
|
FScopeBarrier(int flags1, int flags2, const char* name)
|
||||||
{
|
{
|
||||||
sidefrom = -1;
|
sidefrom = -1;
|
||||||
sidelast = -1;
|
sidelast = -1;
|
||||||
|
|
|
@ -216,7 +216,7 @@ class_flags(X) ::= class_flags(A) NONEW. { X.Flags = A.Flags | ZCC_NoNew; X.
|
||||||
class_flags(X) ::= class_flags(A) NATIVE. { X.Flags = A.Flags | ZCC_Native; X.Replaces = A.Replaces; }
|
class_flags(X) ::= class_flags(A) NATIVE. { X.Flags = A.Flags | ZCC_Native; X.Replaces = A.Replaces; }
|
||||||
class_flags(X) ::= class_flags(A) UI. { X.Flags = A.Flags | ZCC_UIFlag; X.Replaces = A.Replaces; }
|
class_flags(X) ::= class_flags(A) UI. { X.Flags = A.Flags | ZCC_UIFlag; X.Replaces = A.Replaces; }
|
||||||
class_flags(X) ::= class_flags(A) PLAY. { X.Flags = A.Flags | ZCC_Play; X.Replaces = A.Replaces; }
|
class_flags(X) ::= class_flags(A) PLAY. { X.Flags = A.Flags | ZCC_Play; X.Replaces = A.Replaces; }
|
||||||
class_flags(X) ::= class_flags(A) ALLOWUI. { X.Flags = A.Flags | ZCC_AllowUI; X.Replaces = A.Replaces; }
|
class_flags(X) ::= class_flags(A) CLEARSCOPE. { X.Flags = A.Flags | ZCC_ClearScope; X.Replaces = A.Replaces; }
|
||||||
class_flags(X) ::= class_flags(A) REPLACES dottable_id(B). { X.Flags = A.Flags; X.Replaces = B; }
|
class_flags(X) ::= class_flags(A) REPLACES dottable_id(B). { X.Flags = A.Flags; X.Replaces = B; }
|
||||||
|
|
||||||
/*----- Dottable Identifier -----*/
|
/*----- Dottable Identifier -----*/
|
||||||
|
@ -332,7 +332,7 @@ struct_def(X) ::= STRUCT(T) IDENTIFIER(A) struct_flags(S) LBRACE opt_struct_body
|
||||||
struct_flags(X) ::= . { X.Flags = 0; }
|
struct_flags(X) ::= . { X.Flags = 0; }
|
||||||
struct_flags(X) ::= struct_flags(A) UI. { X.Flags = A.Flags | ZCC_UIFlag; }
|
struct_flags(X) ::= struct_flags(A) UI. { X.Flags = A.Flags | ZCC_UIFlag; }
|
||||||
struct_flags(X) ::= struct_flags(A) PLAY. { X.Flags = A.Flags | ZCC_Play; }
|
struct_flags(X) ::= struct_flags(A) PLAY. { X.Flags = A.Flags | ZCC_Play; }
|
||||||
struct_flags(X) ::= struct_flags(A) ALLOWUI. { X.Flags = A.Flags | ZCC_AllowUI; }
|
struct_flags(X) ::= struct_flags(A) CLEARSCOPE. { X.Flags = A.Flags | ZCC_ClearScope; }
|
||||||
struct_flags(X) ::= struct_flags(A) NATIVE. { X.Flags = A.Flags | ZCC_Native; }
|
struct_flags(X) ::= struct_flags(A) NATIVE. { X.Flags = A.Flags | ZCC_Native; }
|
||||||
|
|
||||||
opt_struct_body(X) ::= . { X = NULL; }
|
opt_struct_body(X) ::= . { X = NULL; }
|
||||||
|
@ -1008,7 +1008,7 @@ decl_flag(X) ::= OVERRIDE(T). { X.Int = ZCC_Override; X.SourceLoc = T.SourceLoc
|
||||||
decl_flag(X) ::= VARARG(T). { X.Int = ZCC_VarArg; X.SourceLoc = T.SourceLoc; }
|
decl_flag(X) ::= VARARG(T). { X.Int = ZCC_VarArg; X.SourceLoc = T.SourceLoc; }
|
||||||
decl_flag(X) ::= UI(T). { X.Int = ZCC_UIFlag; X.SourceLoc = T.SourceLoc; }
|
decl_flag(X) ::= UI(T). { X.Int = ZCC_UIFlag; X.SourceLoc = T.SourceLoc; }
|
||||||
decl_flag(X) ::= PLAY(T). { X.Int = ZCC_Play; X.SourceLoc = T.SourceLoc; }
|
decl_flag(X) ::= PLAY(T). { X.Int = ZCC_Play; X.SourceLoc = T.SourceLoc; }
|
||||||
decl_flag(X) ::= ALLOWUI(T). { X.Int = ZCC_AllowUI; X.SourceLoc = T.SourceLoc; }
|
decl_flag(X) ::= CLEARSCOPE(T). { X.Int = ZCC_ClearScope; X.SourceLoc = T.SourceLoc; }
|
||||||
|
|
||||||
func_const(X) ::= . { X.Int = 0; X.SourceLoc = stat->sc->GetMessageLine(); }
|
func_const(X) ::= . { X.Int = 0; X.SourceLoc = stat->sc->GetMessageLine(); }
|
||||||
func_const(X) ::= CONST(T). { X.Int = ZCC_FuncConst; X.SourceLoc = T.SourceLoc; }
|
func_const(X) ::= CONST(T). { X.Int = ZCC_FuncConst; X.SourceLoc = T.SourceLoc; }
|
||||||
|
|
|
@ -615,7 +615,7 @@ void ZCCCompiler::CreateClassTypes()
|
||||||
if (c->cls->Flags & ZCC_NoNew || (parent->ObjectFlags & OF_NoNew))
|
if (c->cls->Flags & ZCC_NoNew || (parent->ObjectFlags & OF_NoNew))
|
||||||
c->Type()->ObjectFlags |= OF_NoNew;
|
c->Type()->ObjectFlags |= OF_NoNew;
|
||||||
//
|
//
|
||||||
static int incompatible[] = { ZCC_UIFlag, ZCC_Play, ZCC_AllowUI };
|
static int incompatible[] = { ZCC_UIFlag, ZCC_Play, ZCC_ClearScope };
|
||||||
int incompatiblecnt = 0;
|
int incompatiblecnt = 0;
|
||||||
for (int k = 0; k < countof(incompatible); k++)
|
for (int k = 0; k < countof(incompatible); k++)
|
||||||
if (incompatible[k] & c->cls->Flags) incompatiblecnt++;
|
if (incompatible[k] & c->cls->Flags) incompatiblecnt++;
|
||||||
|
@ -625,9 +625,9 @@ void ZCCCompiler::CreateClassTypes()
|
||||||
Error(c->cls, "Class %s has incompatible flags", c->NodeName().GetChars());
|
Error(c->cls, "Class %s has incompatible flags", c->NodeName().GetChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c->cls->Flags & ZCC_UIFlag || ((parent->ObjectFlags & OF_UI) && !(c->cls->Flags & ZCC_AllowUI)))
|
if (c->cls->Flags & ZCC_UIFlag || ((parent->ObjectFlags & OF_UI) && !(c->cls->Flags & ZCC_ClearScope)))
|
||||||
c->Type()->ObjectFlags = (c->Type()->ObjectFlags&~OF_Play) | OF_UI;
|
c->Type()->ObjectFlags = (c->Type()->ObjectFlags&~OF_Play) | OF_UI;
|
||||||
if (c->cls->Flags & ZCC_Play || ((parent->ObjectFlags & OF_Play) && !(c->cls->Flags & ZCC_AllowUI)))
|
if (c->cls->Flags & ZCC_Play || ((parent->ObjectFlags & OF_Play) && !(c->cls->Flags & ZCC_ClearScope)))
|
||||||
c->Type()->ObjectFlags = (c->Type()->ObjectFlags&~OF_UI) | OF_Play;
|
c->Type()->ObjectFlags = (c->Type()->ObjectFlags&~OF_UI) | OF_Play;
|
||||||
|
|
||||||
c->Type()->bExported = true; // this class is accessible to script side type casts. (The reason for this flag is that types like PInt need to be skipped.)
|
c->Type()->bExported = true; // this class is accessible to script side type casts. (The reason for this flag is that types like PInt need to be skipped.)
|
||||||
|
@ -1097,7 +1097,7 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray<ZCC_VarDeclarator *> &Fiel
|
||||||
varflags = (varflags&~VARF_Play) | VARF_UI;
|
varflags = (varflags&~VARF_Play) | VARF_UI;
|
||||||
if (field->Flags & ZCC_Play)
|
if (field->Flags & ZCC_Play)
|
||||||
varflags = (varflags&~VARF_UI) | VARF_Play;
|
varflags = (varflags&~VARF_UI) | VARF_Play;
|
||||||
if (field->Flags & ZCC_AllowUI)
|
if (field->Flags & ZCC_ClearScope)
|
||||||
varflags = (varflags&~(VARF_UI | VARF_Play));
|
varflags = (varflags&~(VARF_UI | VARF_Play));
|
||||||
|
|
||||||
if (field->Flags & ZCC_Native)
|
if (field->Flags & ZCC_Native)
|
||||||
|
@ -1105,7 +1105,7 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray<ZCC_VarDeclarator *> &Fiel
|
||||||
varflags |= VARF_Native | VARF_Transient;
|
varflags |= VARF_Native | VARF_Transient;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int excludescope[] = { ZCC_UIFlag, ZCC_Play, ZCC_AllowUI };
|
static int excludescope[] = { ZCC_UIFlag, ZCC_Play, ZCC_ClearScope };
|
||||||
int excludeflags = 0;
|
int excludeflags = 0;
|
||||||
int fc = 0;
|
int fc = 0;
|
||||||
for (int i = 0; i < countof(excludescope); i++)
|
for (int i = 0; i < countof(excludescope); i++)
|
||||||
|
@ -1265,7 +1265,7 @@ bool ZCCCompiler::CompileProperties(PClass *type, TArray<ZCC_Property *> &Proper
|
||||||
FString ZCCCompiler::FlagsToString(uint32_t flags)
|
FString ZCCCompiler::FlagsToString(uint32_t flags)
|
||||||
{
|
{
|
||||||
|
|
||||||
const char *flagnames[] = { "native", "static", "private", "protected", "latent", "final", "meta", "action", "deprecated", "readonly", "const", "abstract", "extend", "virtual", "override", "transient", "vararg", "nonew", "ui", "play", "allowui" };
|
const char *flagnames[] = { "native", "static", "private", "protected", "latent", "final", "meta", "action", "deprecated", "readonly", "const", "abstract", "extend", "virtual", "override", "transient", "vararg", "nonew", "ui", "play", "clearscope" };
|
||||||
FString build;
|
FString build;
|
||||||
|
|
||||||
for (size_t i = 0; i < countof(flagnames); i++)
|
for (size_t i = 0; i < countof(flagnames); i++)
|
||||||
|
@ -2120,12 +2120,12 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
|
||||||
if (c->Type()->ObjectFlags & OF_Play)
|
if (c->Type()->ObjectFlags & OF_Play)
|
||||||
varflags |= VARF_Play;
|
varflags |= VARF_Play;
|
||||||
if (f->Flags & ZCC_FuncConst)
|
if (f->Flags & ZCC_FuncConst)
|
||||||
varflags = (varflags&~(VARF_Play | VARF_UI)); // const implies allowui. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag.
|
varflags = (varflags&~(VARF_Play | VARF_UI)); // const implies clearscope. this is checked a bit later to also not have ZCC_Play/ZCC_UIFlag.
|
||||||
if (f->Flags & ZCC_UIFlag)
|
if (f->Flags & ZCC_UIFlag)
|
||||||
varflags = (varflags&~VARF_Play) | VARF_UI;
|
varflags = (varflags&~VARF_Play) | VARF_UI;
|
||||||
if (f->Flags & ZCC_Play)
|
if (f->Flags & ZCC_Play)
|
||||||
varflags = (varflags&~VARF_UI) | VARF_Play;
|
varflags = (varflags&~VARF_UI) | VARF_Play;
|
||||||
if (f->Flags & ZCC_AllowUI)
|
if (f->Flags & ZCC_ClearScope)
|
||||||
varflags = (varflags&~(VARF_Play | VARF_UI));
|
varflags = (varflags&~(VARF_Play | VARF_UI));
|
||||||
|
|
||||||
if ((f->Flags & ZCC_VarArg) && !(f->Flags & ZCC_Native))
|
if ((f->Flags & ZCC_VarArg) && !(f->Flags & ZCC_Native))
|
||||||
|
@ -2180,7 +2180,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
|
||||||
Error(f, "Invalid combination of qualifiers %s on function %s", FlagsToString(f->Flags&(ZCC_FuncConst | ZCC_UIFlag | ZCC_Play)).GetChars(), FName(f->Name).GetChars());
|
Error(f, "Invalid combination of qualifiers %s on function %s", FlagsToString(f->Flags&(ZCC_FuncConst | ZCC_UIFlag | ZCC_Play)).GetChars(), FName(f->Name).GetChars());
|
||||||
}
|
}
|
||||||
|
|
||||||
static int excludescope[] = { ZCC_UIFlag, ZCC_Play, ZCC_AllowUI };
|
static int excludescope[] = { ZCC_UIFlag, ZCC_Play, ZCC_ClearScope };
|
||||||
excludeflags = 0;
|
excludeflags = 0;
|
||||||
fc = 0;
|
fc = 0;
|
||||||
for (int i = 0; i < countof(excludescope); i++)
|
for (int i = 0; i < countof(excludescope); i++)
|
||||||
|
@ -2408,7 +2408,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
|
||||||
{
|
{
|
||||||
Error(f, "Attempt to override final function %s", FName(f->Name).GetChars());
|
Error(f, "Attempt to override final function %s", FName(f->Name).GetChars());
|
||||||
}
|
}
|
||||||
// you can't change ui/play/allowui for a virtual method.
|
// you can't change ui/play/clearscope for a virtual method.
|
||||||
if ((oldfunc->ScopePlay != sym->Variants[0].Implementation->ScopePlay) ||
|
if ((oldfunc->ScopePlay != sym->Variants[0].Implementation->ScopePlay) ||
|
||||||
(oldfunc->ScopeUI != sym->Variants[0].Implementation->ScopeUI))
|
(oldfunc->ScopeUI != sym->Variants[0].Implementation->ScopeUI))
|
||||||
{
|
{
|
||||||
|
|
|
@ -139,7 +139,7 @@ static void InitTokenMap()
|
||||||
TOKENDEF (TK_VarArg, ZCC_VARARG);
|
TOKENDEF (TK_VarArg, ZCC_VARARG);
|
||||||
TOKENDEF (TK_UI, ZCC_UI);
|
TOKENDEF (TK_UI, ZCC_UI);
|
||||||
TOKENDEF (TK_Play, ZCC_PLAY);
|
TOKENDEF (TK_Play, ZCC_PLAY);
|
||||||
TOKENDEF (TK_AllowUI, ZCC_ALLOWUI);
|
TOKENDEF (TK_ClearScope, ZCC_CLEARSCOPE);
|
||||||
TOKENDEF (TK_NoNew, ZCC_NONEW);
|
TOKENDEF (TK_NoNew, ZCC_NONEW);
|
||||||
TOKENDEF (TK_Override, ZCC_OVERRIDE);
|
TOKENDEF (TK_Override, ZCC_OVERRIDE);
|
||||||
TOKENDEF (TK_Final, ZCC_FINAL);
|
TOKENDEF (TK_Final, ZCC_FINAL);
|
||||||
|
|
|
@ -40,7 +40,7 @@ enum
|
||||||
ZCC_NoNew = 1 << 17,
|
ZCC_NoNew = 1 << 17,
|
||||||
ZCC_UIFlag = 1 << 18, // there's also token called ZCC_UI
|
ZCC_UIFlag = 1 << 18, // there's also token called ZCC_UI
|
||||||
ZCC_Play = 1 << 19,
|
ZCC_Play = 1 << 19,
|
||||||
ZCC_AllowUI = 1 << 20,
|
ZCC_ClearScope = 1 << 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function parameter modifiers
|
// Function parameter modifiers
|
||||||
|
|
Loading…
Reference in a new issue