Added record update field punning
This commit is contained in:
parent
c12a0cffc8
commit
fc710d038f
@ -508,10 +508,10 @@ public class Interpreter : AST.IExprVisitor<Env, object>
|
||||
throw new RuntimeError(tok, "Record updates must be to unique fields.");
|
||||
}
|
||||
updateLabels.Add(label);
|
||||
if (update.Value == null) throw new NotImplementedException();
|
||||
var updateValue = update.Value == null ? env[update.Name] : evaluate(env, update.Value);
|
||||
try
|
||||
{
|
||||
baseRec = baseRec.Update(label, evaluate(env, update.Value));
|
||||
baseRec = baseRec.Update(label, updateValue);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user