}
if(dest.kind != classType && source.kind == classType && source._class && source._class.registered &&
- !strcmp(source._class.registered.fullName, "ecere::com::unichar"))
+ !strcmp(source._class.registered.fullName, "unichar" /*"ecere::com::unichar"*/))
{
FreeType(source);
source = Type { kind = intType, isSigned = false, refCount = 1 };
return null;
}
-static void ProcessDeclaration(Declaration decl);
-
/*static */Symbol FindSymbol(const char * name, Context startContext, Context endContext, bool isStruct, bool globalNameSpace)
{
#ifdef _DEBUG
}
}
-static void ProcessSpecifier(Specifier spec, bool declareStruct)
+static void ProcessSpecifier(Specifier spec, bool declareStruct, bool warnClasses)
{
switch(spec.type)
{
spec.type = nameSpecifier;
spec.name = ReplaceThisClass(thisClass);
spec.symbol = FindClass(spec.name);
- ProcessSpecifier(spec, declareStruct);
+ ProcessSpecifier(spec, declareStruct, false);
}
}
break;
else if(spec.symbol /*&& declareStruct*/)
{
Class c = spec.symbol.registered;
+ if(warnClasses && !c)
+ Compiler_Warning("Undeclared class %s\n", spec.name);
DeclareStruct(curExternal, spec.name, c && c.type == noHeadClass, declareStruct && c && c.type == structClass);
}
break;
spec.type = nameSpecifier;
spec.name = ReplaceThisClass(thisClass);
spec.symbol = FindClass(spec.name);
- ProcessSpecifier(spec, false);
+ ProcessSpecifier(spec, false, false);
}
break;
}
}
else if(spec.type == nameSpecifier)
{
- ProcessSpecifier(spec, isFunction);
+ ProcessSpecifier(spec, isFunction, true);
}
}
}
}
}
-static void ProcessDeclaration(Declaration decl)
+static void ProcessDeclaration(Declaration decl, bool warnClasses)
{
yylloc = decl.loc;
switch(decl.type)
Specifier s;
for(s = decl.specifiers->first; s; s = s.next)
{
- ProcessSpecifier(s, declareStruct);
+ ProcessSpecifier(s, declareStruct, true);
}
}
break;
if(decl.specifiers)
{
for(spec = decl.specifiers->first; spec; spec = spec.next)
- ProcessSpecifier(spec, declareStruct);
+ ProcessSpecifier(spec, declareStruct, warnClasses);
}
break;
}
if(stmt.compound.declarations)
{
for(decl = stmt.compound.declarations->first; decl; decl = decl.next)
- ProcessDeclaration(decl);
+ ProcessDeclaration(decl, true);
}
if(stmt.compound.statements)
{
}
ProcessExpressionType(expIt);
if(stmt.compound.declarations->first)
- ProcessDeclaration(stmt.compound.declarations->first);
+ ProcessDeclaration(stmt.compound.declarations->first, true);
if(symbol)
symbol.isIterator = isMap ? 2 : ((isArray || isBuiltin) ? 3 : (isLinkList ? (isList ? 5 : 4) : (isCustomAVLTree ? 6 : 1)));
}
case badDeclarationStmt:
{
- ProcessDeclaration(stmt.decl);
+ ProcessDeclaration(stmt.decl, true);
break;
}
case asmStmt:
{
Class backThisClass = thisClass;
if(regClass) thisClass = regClass;
- ProcessDeclaration(def.decl);
+ ProcessDeclaration(def.decl, symbol ? true : false);
thisClass = backThisClass;
}
}
currentClass = null;
if(external.declaration)
- ProcessDeclaration(external.declaration);
+ ProcessDeclaration(external.declaration, true);
}
else if(external.type == classExternal)
{