Refactor Names of Scope Types

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-20 04:23:53 -04:00
parent 6a9a138afe
commit f0d816b99f
12 changed files with 144 additions and 163 deletions
+12 -2
View File
@@ -15,5 +15,15 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
public typealias TypeScope = Scope<P4Type>
public typealias TypeScopes = Scopes<P4Type>
/// A scope that resolves variable identifiers to their types.
public typealias VarTypeScope = Scope<P4Type>
/// Scopes that resolve variable identifiers to their types.
public typealias VarTypeScopes = Scopes<P4Type>
/// A scope that resolves type identifiers to their types.
public typealias TypeTypeScope = Scope<P4Type>
/// Scopes that resolve type identifiers to their types.
public typealias TypeTypeScopes = Scopes<P4Type>
+9 -6
View File
@@ -16,8 +16,8 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
open class ProgramExecution: CustomStringConvertible {
public var scopes: ValueScopes = ValueScopes()
let initialValues: ValueScopes?
public var scopes: VarValueScopes = VarValueScopes()
let initialValues: VarValueScopes?
var error: Error?
var debug: DebugLevel = DebugLevel.Error
@@ -25,7 +25,7 @@ open class ProgramExecution: CustomStringConvertible {
initialValues = .none
}
public init(withGlobalValues values: ValueScopes) {
public init(withGlobalValues values: VarValueScopes) {
initialValues = values
}
@@ -88,10 +88,13 @@ open class ProgramExecution: CustomStringConvertible {
return new_pe
}
public func initial_values() -> ValueScopes? {
public func initial_values() -> VarValueScopes? {
return self.initialValues
}
}
public typealias ValueScope = Scope<P4Value>
public typealias ValueScopes = Scopes<P4Value>
/// A scope that resolves variable identifiers to their values.
public typealias VarValueScope = Scope<P4Value>
/// Scopes that resolves variable identifiers to their values.
public typealias VarValueScopes = Scopes<P4Value>