Skip to content

Commit e34945f

Browse files
Fixed scope issue
1 parent f648e7e commit e34945f

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,5 @@ paket-files/
260260

261261
# Visual Studio Code
262262
.vscode/
263+
264+
cfg

Sixty502DotNet.Shared/Helpers/ResourceHandling/FileSystemCharStreamFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public ICharStream GetStream(string source)
3838
{
3939
return CharStreams.fromPath(sourcePath);
4040
}
41-
throw new IOException();
41+
throw new IOException($"Could not open file '{source}'");
4242
}
4343
}
4444

Sixty502DotNet.Shared/Runtime/Interpreter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ private int GenListing(SyntaxParser.InstructionContext context, char leadingChar
308308

309309
private void PushAnonymousScope(int scopeIndex)
310310
{
311+
Services.State.PassNeeded |= Services.State.InFirstPass;
311312
if (Services.State.Symbols.LookupToScope($"::{scopeIndex}") is not AnonymousScope scope)
312313
{
313314
scope = new AnonymousScope(scopeIndex, Services.State.Symbols.ActiveScope);

Sixty502DotNet.Shared/Runtime/InterpreterStatements.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Licensed under the MIT license. See LICENSE for full license information.
55
//
66
//-----------------------------------------------------------------------------
7-
7+
88
using Antlr4.Runtime.Misc;
99

1010
namespace Sixty502DotNet.Shared;
@@ -97,6 +97,7 @@ public override int VisitStatConstant([NotNull] SyntaxParser.StatConstantContext
9797

9898
public override int VisitStatBlock([NotNull] SyntaxParser.StatBlockContext context)
9999
{
100+
Services.State.PassNeeded |= Services.State.InFirstPass;
100101
CheckWhiteSpaceLeftOfLabel(context.name);
101102
if (context.name?.Identifier() == null)
102103
{

0 commit comments

Comments
 (0)