Implements support for functions with the same name, but different parameters
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -17,8 +17,6 @@ namespace Porygon::Diagnostics {
|
||||
CantAssignVariable,
|
||||
VariableNotFound,
|
||||
ExpressionIsNotAFunction,
|
||||
ParameterCountMismatch,
|
||||
ParameterTypeMismatch,
|
||||
CantIndex,
|
||||
InvalidReturnType,
|
||||
ConditionNotABool,
|
||||
@@ -27,7 +25,8 @@ namespace Porygon::Diagnostics {
|
||||
UserDataFieldNoGetter,
|
||||
UserDataFieldNoSetter,
|
||||
NumericalForArgumentNotANumber,
|
||||
CantIterateExpression
|
||||
CantIterateExpression,
|
||||
InvalidFunctionParameters
|
||||
};
|
||||
}
|
||||
#endif //PORYGONLANG_DIAGNOSTICCODE_HPP
|
||||
|
||||
@@ -48,16 +48,16 @@ size_t DiagnosticsHolder::GetLineFromPosition(size_t i) {
|
||||
if (bottomLimit == topLimit){
|
||||
return bottomLimit;
|
||||
}
|
||||
size_t half = (topLimit - bottomLimit) / 2;
|
||||
size_t half = bottomLimit + ((topLimit - bottomLimit) / 2);
|
||||
size_t pos = _lineStarts[half];
|
||||
size_t length = _lineLength[half];
|
||||
if (pos < i && pos + length > i){
|
||||
return half;
|
||||
}
|
||||
if (pos > i){
|
||||
bottomLimit = half;
|
||||
} else if (pos < i){
|
||||
topLimit = half;
|
||||
} else if (pos < i){
|
||||
bottomLimit = half;
|
||||
} else{
|
||||
return half;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user