compiler: Refactor Compiler To Remove Ambiguities
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:
@@ -94,7 +94,7 @@ extension Cli {
|
||||
return
|
||||
}
|
||||
|
||||
let maybe_program = Program.Compile(source.getSource())
|
||||
let maybe_program = SpecialCompilers.ProgramCompiler.Compile(source.getSource())
|
||||
guard case .Ok(_) = maybe_program else {
|
||||
let feedback = CompilationFeedback(source, [maybe_program.error()!], formatter)
|
||||
print(feedback.feedback)
|
||||
@@ -134,7 +134,7 @@ extension Cli {
|
||||
return
|
||||
}
|
||||
|
||||
let maybe_program = Program.Compile(source.getSource())
|
||||
let maybe_program = SpecialCompilers.ProgramCompiler.Compile(source.getSource())
|
||||
guard case .Ok(let program) = maybe_program else {
|
||||
print(ErrorWithLabel("Compiler Error", maybe_source.error()!).format(formatter))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user