INNER CODE UNIT · Swift

getSystemSortOrder

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

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…