Add update Methods for Compilation Context

update method will allow the creation of a new compilation context
based on the current one with new types/names.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-13 07:03:31 -04:00
parent 636db140ce
commit 377f40447f
4 changed files with 34 additions and 4 deletions
+1 -1
View File
@@ -338,7 +338,7 @@ public struct Parser {
// Parse a state in a nested scope.
switch Parser.State.Compile(
node: parser_state, withContext: CompilerContext(withNames: current_context.names.enter()))
node: parser_state, withContext: context.update(newNames: current_context.names.enter()))
{
case Result.Ok(let (state, updated_context)):
parser.states = parser.states.append(state: state)