INNER CODE UNIT · Swift

getRenderingSystemPhase

STREGAsGate/GateEngine · Macros/ECSMacros/ECSRenderingSystemMacro.swift:38

        func getRenderingSystemPhase() throws -> TokenSyntax {
            switch node.arguments {
            case .argumentList(let labeledExprListSyntax):
                if let token = labeledExprListSyntax.lastToken(viewMode: .sourceAccurate) {
                    return "\(token.formatted())"
                }
            default:
                break
            }
            throw RenderingSystemMacroError.invalidPhase
        }
        
        let argument: String = try getRenderingSystemPhase().formatted().description
        
        var syntax = "override class var phase: RenderingSystem.Phase { .\(argument)}"
        
        if let access = classDecl.modifiers.first(where: {
            let syntax = $0.trimmed.description

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…