compiler: Refactor Compiler To Remove Ambiguities
Continuous Integration / Grammar Tests (push) Successful in 39s
Continuous Integration / Library Format Tests (push) Successful in 1m51s
Continuous Integration / Library Tests (push) Failing after 4m44s

There were significant overlaps in the names of data structures
between the compiler and the language that made it necessary
to litter the code with P4Lang.xxxx. This refactor removes that
requirement in most places (Parser is ambiguous wherever TreeSitter
is used -- cannot avoid that!)

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-05-27 12:59:29 -04:00
parent 61d8f601e8
commit 294f76acd4
39 changed files with 735 additions and 699 deletions
+4 -4
View File
@@ -66,7 +66,7 @@ extension ParserStateDirectTransitionValue: EvaluatableParserState {
return false
}
public func state() -> P4Lang.ParserState {
public func state() -> ParserState {
return self.state
}
}
@@ -82,7 +82,7 @@ extension ParserStateNoTransitionValue: EvaluatableParserState {
return true
}
public func state() -> P4Lang.ParserState {
public func state() -> ParserState {
return self.state
}
}
@@ -125,7 +125,7 @@ extension ParserStateSelectTransitionValue: EvaluatableParserState {
return false
}
public func state() -> P4Lang.ParserState {
public func state() -> ParserState {
return self.state
}
}
@@ -134,7 +134,7 @@ extension ParserValue: LibraryCallable {
public typealias T = InstantiatedParserState
public func call(
execution: Common.ProgramExecution, arguments: ArgumentList
) -> (P4Lang.InstantiatedParserState, Common.ProgramExecution) {
) -> (InstantiatedParserState, Common.ProgramExecution) {
var execution = execution.enter_scope()
execution = execution.declare(