Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
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: 2 additions & 0 deletions src/Analysis/Ast/Impl/Extensions/ScopeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public static int GetBodyStartIndex(this IScope scope) {
return cd.HeaderIndex;
case FunctionDefinition fd:
return fd.HeaderIndex;
case null:
return 0;
default:
return scope.Node.StartIndex;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Analysis/Ast/Impl/Values/Scope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ public EmptyGlobalScope(IPythonModule module) {
}
public IPythonModule Module { get; }
public string Name => string.Empty;
public ScopeStatement Node => null;
public ScopeStatement Node => Module.Analysis.Ast;
public IScope OuterScope => null;
public IGlobalScope GlobalScope { get; protected set; }
public IGlobalScope GlobalScope { get; }
public IReadOnlyList<IScope> Children => Array.Empty<IScope>();
public IEnumerable<IScope> EnumerateTowardsGlobal => Enumerable.Repeat(this, 1);
public IEnumerable<IScope> EnumerateFromGlobal => Enumerable.Repeat(this, 1);
Expand Down