static bool InsideIncl(Location loc, int line, int charPos)
{
/*
- return (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
+ return (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
(loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
*/
- return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
+ return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos <= charPos)) &&
(loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
}
static bool Inside(Location loc, int line, int charPos)
{
- return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
+ return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
(loc.end.line > line || (loc.end.line == line && loc.end.charPos > charPos));
}
static bool InsideEndIncl(Location loc, int line, int charPos)
{
- return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
+ return !loc.start.included && (loc.start.line < line || (loc.start.line == line && loc.start.charPos < charPos)) &&
(loc.end.line > line || (loc.end.line == line && loc.end.charPos >= charPos));
}
case bracketsExp:
{
Expression expression;
-
+
for(expression = exp.list->first; expression; expression = expression.next)
{
if(InsideIncl(&expression.loc, line, charPos))
idResult = FindParamsExpression(exp.index.exp, line, charPos);
if(idResult) return idResult;
}
-
+
for(expression = exp.index.index->first; expression; expression = expression.next)
{
if(InsideIncl(&expression.loc, line, charPos))
if(!functionType && !instanceType)
{
functionType = type;
- if(paramsInsideExp == exp.call.exp)
+ if(paramsInsideExp == exp.call.exp)
paramsInsideExp = exp;
}
if(idResult) return idResult;
}
-
+
if(exp.call.argLoc.start.line > line || (line == exp.call.argLoc.start.line && exp.call.argLoc.start.charPos >= charPos))
arg = -1;
- else
+ else
arg = 0;
if(exp.call.arguments)
{
int c;
Type param;
+ if(type.kind == methodType)
+ type = type.method.dataType;
paramsInsideExp = exp;
functionType = type;
idResult = FindParamsStatement(stmt.forStmt.init, line, charPos);
if(idResult) return idResult;
}
-
+
if(stmt.forStmt.check && InsideIncl(&stmt.forStmt.check.loc, line, charPos))
{
idResult = FindParamsStatement(stmt.forStmt.check, line, charPos);
if(idResult) return idResult;
}
-
+
if(stmt.forStmt.increment)
{
for(exp = stmt.forStmt.increment->first; exp; exp = exp.next)
if(stmt.expressions)
{
Expression exp;
-
+
for(exp = stmt.expressions->first; exp; exp = exp.next)
{
if(InsideIncl(&exp.loc, line, charPos))
{
Initializer init;
Identifier idResult;
-
+
for(init = initializer.list->first; init; init = init.next)
{
if(InsideIncl(&init.loc, line, charPos))
static Identifier FindParamsDeclaration(Declaration decl, int line, int charPos)
{
Identifier idResult;
-
+
switch(decl.type)
{
case structDeclaration:
idResult = FindParamsInitDeclarator(d, line, charPos);
if(idResult) return idResult;
}
- }
+ }
}
break;
}
if(func.body && Inside(&func.body.loc, line, charPos))
{
Identifier idResult;
-
+
Identifier id = GetDeclId(func.declarator);
Symbol symbol = func.declarator.symbol;
Type type = symbol.type;
{
curMember = thisMember;
curClass = thisMember._class;
- memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
+ memcpy(subMemberStack, _subMemberStack, sizeof(DataMember) * _subMemberStackPos);
subMemberStackPos = _subMemberStackPos;
}
}
}
if(!insideParams && sym && sym.registered && InsideIncl(&inst.insideLoc, line, charPos) && insideBrackets && !insideSomething)
{
- if(dataMember && !method)
+ if(dataMember && !method)
{
if(!dataMember.dataType)
dataMember.dataType = ProcessTypeString(dataMember.dataTypeString, false);
if(func.body && Inside(&func.body.loc, line, charPos))
{
Identifier idResult;
-
+
Identifier id = GetDeclId(func.declarator);
Symbol symbol = func.declarator ? func.declarator.symbol : null;
Type type = symbol ? symbol.type : null;
{
switch(external.type)
{
- case functionExternal:
+ case functionExternal:
if(Inside(&external.loc, line, charPos))
{
idResult = FindParamsFunction(external.function, line, charPos);
return (idResult == (void *)-1) ? null : idResult;
}
break;
- case declarationExternal:
+ case declarationExternal:
if(InsideIncl(&external.loc, line, charPos))
{
idResult = FindParamsDeclaration(external.declaration, line, charPos);