compiler, language, runtime: Separate Parser Type From Instances
In P4, parsers are considered types. Those parsers are instantiated. The instantiated parsers are values. Previously, gp4 treated a parser type and a parser value as identical. This PR makes that difference clear _and_ sets the stage for the future. TODO: Make the same distinction between control and action types and values. Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -51,7 +51,8 @@ extension TypedIdentifier: CompilableExpression {
|
||||
sourceLocation: node.toSourceLocation(), withError: "Cannot find \(node.text!) in scope"))
|
||||
}
|
||||
|
||||
return .Ok(TypedIdentifier(name: node.text!, withType: type))
|
||||
/// TODO: If there is a value here, then we can make this a compile-time constant!
|
||||
return .Ok(TypedIdentifier(name: node.text!, withType: type.0))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user