compiler, runtime, common: Support (in)out Parameters
When a function is called, if there is an (in)out parameter, make sure that updated values are propogated to the calling function. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -87,6 +87,12 @@ open class ProgramExecution: CustomStringConvertible {
|
||||
return new_pe
|
||||
}
|
||||
|
||||
public func replaceScopes(_ new_scopes: VarValueScopes) -> ProgramExecution {
|
||||
let new_pe = ProgramExecution(copy: self)
|
||||
new_pe.scopes = new_scopes
|
||||
return new_pe
|
||||
}
|
||||
|
||||
public func declare(identifier: Identifier, withValue value: P4Value) -> ProgramExecution {
|
||||
let new_pe = ProgramExecution(copy: self)
|
||||
let new_scopes = new_pe.scopes.declare(identifier: identifier, withValue: value)
|
||||
|
||||
Reference in New Issue
Block a user