compiler, runtime: Refactor P4DataType to P4Type

Now that the old P4Type is a P4QualifiedType, it makes sense to
rename the data type back to just type.

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-04 07:37:48 -04:00
parent 7c660b2b0c
commit 5cfe5532a2
15 changed files with 77 additions and 77 deletions
+6 -6
View File
@@ -17,8 +17,8 @@
import Common
public struct Action: CustomStringConvertible, P4DataType, P4DataValue {
public func type() -> any Common.P4DataType {
public struct Action: CustomStringConvertible, P4Type, P4DataValue {
public func type() -> any P4Type {
return self
}
@@ -29,7 +29,7 @@ public struct Action: CustomStringConvertible, P4DataType, P4DataValue {
}
}
public func eq(rhs: any Common.P4DataType) -> Bool {
public func eq(rhs: any P4Type) -> Bool {
return switch rhs {
case is Action: true
default: false
@@ -194,20 +194,20 @@ public struct Table: CustomStringConvertible {
}
}
public struct Control: P4DataType, P4DataValue, Equatable, CustomStringConvertible {
public struct Control: P4Type, P4DataValue, Equatable, CustomStringConvertible {
public static func == (lhs: Control, rhs: Control) -> Bool {
// Two "bare" controls are always equal.
return true
}
public func eq(rhs: any Common.P4DataType) -> Bool {
public func eq(rhs: any P4Type) -> Bool {
return switch rhs {
case is Control: true
default: false
}
}
public func type() -> any Common.P4DataType {
public func type() -> any P4Type {
return self
}