Ensure code follows established Swift naming conventions and remains consistent with domain terminology: 1. Use standard Swift parameter labels (e.g., use `named:` instead of `called:`):
Ensure code follows established Swift naming conventions and remains consistent with domain terminology:
named:
instead of called:
):
```swift
// Incorrect
func expectOne// Correct
func expectOne
2. Organize functions as methods on relevant types when appropriate:
```swift
// Less idiomatic
public func operandNames(for inst: Instruction) -> [String]? { ... }
// More idiomatic
extension Instruction {
public var operandNames: [String]? { ... }
}
Use domain-specific terminology consistently (e.g., “operand names” not “registers” in SIL context)
Avoid redundancy in type names, especially in enum cases: ```swift // Redundant public indirect enum Type { case addressType(_ type: Type) }
// Concise public indirect enum Type { case address(Type) } ```
inst
instead of instr
for variables if that’s the established pattern)Enter the URL of a public GitHub repository