Skip to content

Commit

Permalink
Added declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Oct 26, 2024
1 parent 39d6e98 commit d0f7360
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Draco.Compiler.Api.Syntax;
using Draco.Compiler.Internal.Binding;
using Draco.Compiler.Internal.BoundTree;
using Draco.Compiler.Internal.Declarations;
using Draco.Compiler.Internal.FlowAnalysis;
using Draco.Compiler.Internal.Symbols.Syntax;
using Draco.Compiler.Internal.Symbols.Synthetized.AutoProperty;
Expand Down Expand Up @@ -43,6 +44,11 @@ internal sealed class SourceAutoPropertySymbol(

private readonly object buildLock = new();

public SourceAutoPropertySymbol(Symbol containingSymbol, GlobalDeclaration declaration)
: this(containingSymbol, declaration.Syntax)
{
}

public override void Bind(IBinderProvider binderProvider)
{
this.BindTypeAndValueIfNeeded(binderProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ private ImmutableArray<Symbol> BindMembers(IBinderProvider binderProvider)
};

private SourceFunctionSymbol BuildFunction(FunctionDeclaration declaration) => new(this, declaration);
private SourceFieldSymbol BuildGlobal(GlobalDeclaration declaration) => new(this, declaration);
private Symbol BuildGlobal(GlobalDeclaration declaration) => declaration.Syntax.FieldModifier is null
? new SourceAutoPropertySymbol(this, declaration)
: new SourceFieldSymbol(this, declaration);
private SourceModuleSymbol BuildModule(MergedModuleDeclaration declaration) => new(this.DeclaringCompilation, this, declaration);

private SymbolDocumentation BuildDocumentation() =>
Expand Down

0 comments on commit d0f7360

Please sign in to comment.