Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hot fix #692

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion elenasrc3/elc/cliconst.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace elena_lang
{
#define ELC_REVISION_NUMBER 0x0045
#define ELC_REVISION_NUMBER 0x0046

#if defined _M_IX86 || _M_X64

Expand Down
144 changes: 72 additions & 72 deletions elenasrc3/elc/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ MethodHint operator | (const ref_t& l, const MethodHint& r)
inline bool isSelfCall(ObjectInfo target)
{
switch (target.kind) {
case ObjectKind::SelfLocal:
case ObjectKind::SelfBoxableLocal:
case ObjectKind::OuterSelf:
case ObjectKind::ClassSelf:
case ObjectKind::ConstructorSelf:
//case okInternalSelf:
return true;
default:
case ObjectKind::SelfLocal:
case ObjectKind::SelfBoxableLocal:
case ObjectKind::OuterSelf:
case ObjectKind::ClassSelf:
case ObjectKind::ConstructorSelf:
//case okInternalSelf:
return true;
default:
return false;
}
}
Expand Down Expand Up @@ -167,16 +167,16 @@ void declareArguments(SyntaxNode node, SyntaxTree& dummyTree, List<SyntaxNode>&
SyntaxNode current = node.firstChild();
while (current != SyntaxKey::None) {
switch (current.key) {
case SyntaxKey::Expression:
dummyWriter.newNode(SyntaxKey::Expression);
case SyntaxKey::Expression:
dummyWriter.newNode(SyntaxKey::Expression);

arguments.add(dummyWriter.CurrentNode());
SyntaxTree::copyNode(dummyWriter, current);
arguments.add(dummyWriter.CurrentNode());
SyntaxTree::copyNode(dummyWriter, current);

dummyWriter.closeNode();
break;
default:
break;
dummyWriter.closeNode();
break;
default:
break;
}

current = current.nextNode();
Expand Down Expand Up @@ -217,66 +217,66 @@ inline ref_t mapIntConstant(ModuleScopeBase* moduleScope, int integer)
inline bool isConstant(ObjectKind kind)
{
switch (kind) {
case ObjectKind::IntLiteral:
case ObjectKind::Float64Literal:
case ObjectKind::LongLiteral:
case ObjectKind::StringLiteral:
case ObjectKind::WideStringLiteral:
case ObjectKind::Singleton:
return true;
default:
return false;
case ObjectKind::IntLiteral:
case ObjectKind::Float64Literal:
case ObjectKind::LongLiteral:
case ObjectKind::StringLiteral:
case ObjectKind::WideStringLiteral:
case ObjectKind::Singleton:
return true;
default:
return false;
}
}

inline bool isSingleObject(ObjectKind kind)
{
switch (kind)
{
case ObjectKind::CharacterLiteral:
case ObjectKind::ConstantLiteral:
case ObjectKind::MssgNameLiteral:
case ObjectKind::MssgLiteral:
case ObjectKind::ExtMssgLiteral:
case ObjectKind::Nil:
case ObjectKind::Class:
case ObjectKind::ClassSelf:
case ObjectKind::ConstructorSelf:
case ObjectKind::Param:
case ObjectKind::ParamReference:
case ObjectKind::ParamAddress:
case ObjectKind::ByRefParam:
case ObjectKind::ByRefParamAddress:
case ObjectKind::OutParam:
case ObjectKind::OutParamAddress:
case ObjectKind::Local:
case ObjectKind::LocalReference:
case ObjectKind::RefLocal:
case ObjectKind::TempLocal:
case ObjectKind::SelfLocal:
case ObjectKind::SuperLocal:
case ObjectKind::ReadOnlySelfLocal:
case ObjectKind::LocalAddress:
case ObjectKind::TempLocalAddress:
case ObjectKind::ReadOnlyFieldAddress:
case ObjectKind::FieldAddress:
case ObjectKind::ReadOnlyField:
case ObjectKind::Field:
case ObjectKind::Outer:
case ObjectKind::OuterField:
case ObjectKind::OuterSelf:
case ObjectKind::Closure:
case ObjectKind::ClassConstant:
case ObjectKind::Constant:
case ObjectKind::ConstArray:
case ObjectKind::StaticField:
case ObjectKind::StaticThreadField:
case ObjectKind::StaticConstField:
case ObjectKind::ClassStaticConstField:
case ObjectKind::LocalField:
return true;
default:
return isConstant(kind);
case ObjectKind::CharacterLiteral:
case ObjectKind::ConstantLiteral:
case ObjectKind::MssgNameLiteral:
case ObjectKind::MssgLiteral:
case ObjectKind::ExtMssgLiteral:
case ObjectKind::Nil:
case ObjectKind::Class:
case ObjectKind::ClassSelf:
case ObjectKind::ConstructorSelf:
case ObjectKind::Param:
case ObjectKind::ParamReference:
case ObjectKind::ParamAddress:
case ObjectKind::ByRefParam:
case ObjectKind::ByRefParamAddress:
case ObjectKind::OutParam:
case ObjectKind::OutParamAddress:
case ObjectKind::Local:
case ObjectKind::LocalReference:
case ObjectKind::RefLocal:
case ObjectKind::TempLocal:
case ObjectKind::SelfLocal:
case ObjectKind::SuperLocal:
case ObjectKind::ReadOnlySelfLocal:
case ObjectKind::LocalAddress:
case ObjectKind::TempLocalAddress:
case ObjectKind::ReadOnlyFieldAddress:
case ObjectKind::FieldAddress:
case ObjectKind::ReadOnlyField:
case ObjectKind::Field:
case ObjectKind::Outer:
case ObjectKind::OuterField:
case ObjectKind::OuterSelf:
case ObjectKind::Closure:
case ObjectKind::ClassConstant:
case ObjectKind::Constant:
case ObjectKind::ConstArray:
case ObjectKind::StaticField:
case ObjectKind::StaticThreadField:
case ObjectKind::StaticConstField:
case ObjectKind::ClassStaticConstField:
case ObjectKind::LocalField:
return true;
default:
return isConstant(kind);
}

return false;
Expand Down Expand Up @@ -2729,7 +2729,7 @@ void Compiler::generateParamNameInfo(ClassScope& scope, SyntaxNode node, mssg_t
}
}

void Compiler::generateMethodDeclaration(ClassScope& scope, SyntaxNode node, bool closed, bool hideDuplicate)
void Compiler :: generateMethodDeclaration(ClassScope& scope, SyntaxNode node, bool closed, bool hideDuplicate)
{
mssg_t message = node.arg.reference;
MethodInfo methodInfo = {};
Expand Down Expand Up @@ -8592,7 +8592,7 @@ void Compiler :: compileAsyncMethod(BuildTreeWriter& writer, MethodScope& scope,
*/


assert(true);
assert(false);
}

void Compiler::compileYieldMethod(BuildTreeWriter& writer, MethodScope& scope, SyntaxNode node)
Expand Down Expand Up @@ -11848,7 +11848,7 @@ ObjectInfo Compiler::Expression::compileSpecialOperation(SyntaxNode node, int op

void Compiler::Expression :: compileAsyncOperation(SyntaxNode node)
{
assert(true);
assert(false);
}

void Compiler::Expression :: compileYieldOperation(SyntaxNode node)
Expand Down
2 changes: 1 addition & 1 deletion elenasrc3/engine/langcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ namespace elena_lang
Virtual = 0x00000005,
Dispatcher = 0x00000007,

Async = 0x00000010,
Interpolator = 0x00000020,
Nillable = 0x00000040,
Function = 0x00000080,
Generic = 0x00000100,
RetOverload = 0x00000200,
Async = 0x00000800,
Multimethod = 0x00001000,
TargetSelf = 0x00002000,
Static = 0x00004000,
Expand Down
12 changes: 8 additions & 4 deletions tests60/sandbox/sandbox.l
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import system'threading;

public abstract class BaseValue
{
}

singleton X
{
// Task someMethodAsync1()
Expand All @@ -13,21 +17,21 @@ singleton X
//
// }

async Task test()
/* async Task test()
{
console.writeLine("Before");

$await Task.Run( { console.writeLine("someMethodAsync1"); Thread.delay(1000); });

console.writeLine("After");
}
}*/
}

public program()
{
Task t := X.test();
// Task t := X.test();

t.Result;
// t.Result;

console.readChar()
}
Loading