1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Linux fixes

This commit is contained in:
Brian Fiete 2020-09-29 08:53:36 -07:00
parent b13bee470c
commit a399e383fa
8 changed files with 41 additions and 35 deletions

View file

@ -577,7 +577,6 @@ namespace IDE
llvmDir.Append("llvm/"); llvmDir.Append("llvm/");
#else #else
String llvmDir = ""; String llvmDir = "";
bool isWSL = false;
#endif #endif
if (!gApp.mSettings.mEmscriptenPath.IsEmpty) if (!gApp.mSettings.mEmscriptenPath.IsEmpty)
{ {

View file

@ -6159,7 +6159,7 @@ namespace IDE.ui
} }
else else
{ {
// If we do a non-autocomple change that modifies a type signature, that will generate a Classify which detects // If we do a non-autocomplete change that modifies a type signature, that will generate a Classify which detects
// the signature change afterward, and then we need to do a full classify after that // the signature change afterward, and then we need to do a full classify after that
if (mWantsFullRefresh) if (mWantsFullRefresh)
mWantsFullClassify = true; mWantsFullClassify = true;

View file

@ -1436,7 +1436,7 @@ const char* Beefy::BfTokenToString(BfToken token)
case BfToken_XorEquals: case BfToken_XorEquals:
return "^="; return "^=";
case BfToken_NullCoalsceEquals: case BfToken_NullCoalsceEquals:
return "??="; return "\?\?=";
case BfToken_LBrace: case BfToken_LBrace:
return "{"; return "{";
case BfToken_RBrace: case BfToken_RBrace:

View file

@ -968,34 +968,6 @@ public:
} }
}; };
template <typename T>
class BfDeferredAstNodeSizedArray : public SizedArray<T, 8>
{
public:
BfAstNode* mParentNode;
BfSizedArray<ASTREF(T)>* mSizedArray;
BfAstAllocator* mAlloc;
public:
BfDeferredAstNodeSizedArray(BfAstNode* parentNode, BfSizedArray<ASTREF(T)>& arr, BfAstAllocator* alloc)
{
mParentNode = parentNode;
mSizedArray = &arr;
mAlloc = alloc;
}
~BfDeferredAstNodeSizedArray()
{
BfSizedArrayInitIndirect(*mSizedArray, *this, mAlloc);
if (!this->mSizedArray->IsEmpty())
{
int endPos = this->mSizedArray->back()->mSrcEnd;
if (endPos > this->mParentNode->mSrcEnd)
this->mParentNode->mSrcEnd = endPos;
}
}
};
typedef void(*BfAstAcceptFunc)(BfAstNode* node, BfStructuralVisitor* visitor); typedef void(*BfAstAcceptFunc)(BfAstNode* node, BfStructuralVisitor* visitor);
class BfAstTypeInfo class BfAstTypeInfo
@ -1515,6 +1487,34 @@ T* BfNodeDynCastExact(BfAstNode* node)
BfIdentifierNode* BfIdentifierCast(BfAstNode* node); BfIdentifierNode* BfIdentifierCast(BfAstNode* node);
BfAstNode* BfNodeToNonTemporary(BfAstNode* node); BfAstNode* BfNodeToNonTemporary(BfAstNode* node);
template <typename T>
class BfDeferredAstNodeSizedArray : public SizedArray<T, 8>
{
public:
BfAstNode* mParentNode;
BfSizedArray<ASTREF(T)>* mSizedArray;
BfAstAllocator* mAlloc;
public:
BfDeferredAstNodeSizedArray(BfAstNode* parentNode, BfSizedArray<ASTREF(T)>& arr, BfAstAllocator* alloc)
{
mParentNode = parentNode;
mSizedArray = &arr;
mAlloc = alloc;
}
~BfDeferredAstNodeSizedArray()
{
BfSizedArrayInitIndirect(*mSizedArray, *this, mAlloc);
if (!this->mSizedArray->IsEmpty())
{
int endPos = this->mSizedArray->back()->mSrcEnd;
if (endPos > this->mParentNode->mSrcEnd)
this->mParentNode->mSrcEnd = endPos;
}
}
};
class BfStatement : public BfAstNode class BfStatement : public BfAstNode
{ {
public: public:

View file

@ -3332,6 +3332,9 @@ void BfAutoComplete::FixitAddConstructor(BfTypeInstance *typeInstance)
{ {
case BfParamKind_Params: case BfParamKind_Params:
methodStr += "params "; methodStr += "params ";
break;
default:
break;
} }
methodStr += mModule->TypeToString(methodInstance->GetParamType(paramIdx), BfTypeNameFlag_ReduceName); methodStr += mModule->TypeToString(methodInstance->GetParamType(paramIdx), BfTypeNameFlag_ReduceName);
methodStr += " "; methodStr += " ";
@ -3352,6 +3355,9 @@ void BfAutoComplete::FixitAddConstructor(BfTypeInstance *typeInstance)
{ {
case BfParamKind_Params: case BfParamKind_Params:
methodStr += "params "; methodStr += "params ";
break;
default:
break;
} }
auto paramType = methodInstance->GetParamType(paramIdx); auto paramType = methodInstance->GetParamType(paramIdx);

View file

@ -1689,7 +1689,7 @@ void BfDefBuilder::Visit(BfTypeDeclaration* typeDeclaration)
int outerGenericSize = 0; int outerGenericSize = 0;
if (mCurTypeDef->mOuterType != NULL) if (mCurTypeDef->mOuterType != NULL)
outerGenericSize = (int)mCurTypeDef->mOuterType->mGenericParamDefs.size(); outerGenericSize = (int)mCurTypeDef->mOuterType->mGenericParamDefs.size();
bool isGeneric = (outerGenericSize != NULL) || (typeDeclaration->mGenericParams != NULL); bool isGeneric = (outerGenericSize != 0) || (typeDeclaration->mGenericParams != NULL);
ParseGenericParams(typeDeclaration->mGenericParams, typeDeclaration->mGenericConstraintsDeclaration, mCurTypeDef->mGenericParamDefs, &mCurTypeDef->mExternalConstraints, outerGenericSize, isGeneric); ParseGenericParams(typeDeclaration->mGenericParams, typeDeclaration->mGenericConstraintsDeclaration, mCurTypeDef->mGenericParamDefs, &mCurTypeDef->mExternalConstraints, outerGenericSize, isGeneric);
BF_ASSERT(mCurTypeDef->mNameEx == NULL); BF_ASSERT(mCurTypeDef->mNameEx == NULL);

View file

@ -639,7 +639,7 @@ void BfGNUMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfType
} }
if ((val >= 1) && (val < 10)) if ((val >= 1) && (val < 10))
{ {
val += (char)('0' + val - 1); name += (char)('0' + val - 1);
} }
else else
{ {
@ -649,7 +649,7 @@ void BfGNUMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfType
while (val > 0) while (val > 0)
{ {
*(strP--) = (char)((val % 0x10) + 'A'); *(--strP) = (char)((val % 0x10) + 'A');
val /= 0x10; val /= 0x10;
} }

View file

@ -10954,6 +10954,7 @@ BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue&
{ {
if ((allowUndef) && (constant->mConstType == BfConstType_Undef)) if ((allowUndef) && (constant->mConstType == BfConstType_Undef))
{ {
variant.mUInt64 = 0;
variant.mTypeCode = BfTypeCode_Let; variant.mTypeCode = BfTypeCode_Let;
return variant; return variant;
} }