Added call first machnaism
This commit is contained in:
parent
747b322c32
commit
e9f8b298c2
File diff suppressed because it is too large
Load Diff
26
forEach.js
26
forEach.js
@ -52,6 +52,7 @@ textBuffer +=
|
||||
forN(subn, function(subN) {
|
||||
if (!subN) return
|
||||
var suffix = subN != 1 ? "_" + (subN): ""
|
||||
var suffix2 = subN != 1 ? "_" + (subN): ""
|
||||
var re = Math.min(127 - 3, n * subN)
|
||||
forN(re, function(i) {
|
||||
|
||||
@ -60,17 +61,30 @@ forN(subn, function(subN) {
|
||||
var X = formatNParamPattern(subN, "X")
|
||||
var iM1 = i - 1
|
||||
var iM1Translated = i - subN
|
||||
var iM1Translated2 = (i - 1) - subN
|
||||
if (subN == 1) {
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}, ...) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}, ...) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
textBuffer += `#define AU_FE_${i}_FIRST${suffix}(first, prefix, ${X}, ...) first(${X}) AU_FE_EXPAND(AU_FE_${iM1}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
} else if (i % subN == 0) {
|
||||
if (i == subN) {
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated}${suffix}(prefix))\n`
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated}${suffix}(prefix))\n`
|
||||
} else {
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}, ...) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}, ...) prefix(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
}
|
||||
|
||||
} else {
|
||||
textBuffer += `#define AU_FE_${i}${suffix}(prefix, ${X}, ...) Macro Jump Error\n`
|
||||
}
|
||||
|
||||
if (subN != 1) {
|
||||
if ((i + 1) % (subN) == 0) {
|
||||
if ((i + 1) == subN) {
|
||||
textBuffer += `#define AU_FE_${i}_FIRST${suffix2}(first, prefix, ${X}) first(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated2}${suffix}(prefix))\n`
|
||||
} else {
|
||||
textBuffer += `#define AU_FE_${i}_FIRST${suffix2}(first, prefix, ${X}, ...) first(${X}) AU_FE_EXPAND(AU_FE_${iM1Translated2}${suffix}(prefix, __VA_ARGS__))\n`
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@ -78,8 +92,10 @@ forN(subn, function(subN) {
|
||||
textBuffer += `#define AU_GET_MACRO${suffix}(${GET_MACRO_PARAMS}, NAME,...) NAME\n`
|
||||
|
||||
var params = formatNParamPatternReverseSuffix(re, "AU_FE_", suffix)
|
||||
var finalLine = `#define AU_FOR_EACH${suffix}(action, ...) AU_FE_EXPAND(AU_GET_MACRO${suffix}(_whydoweneedthis, __VA_ARGS__, ${params})(action,__VA_ARGS__))`
|
||||
textBuffer += finalLine
|
||||
var params2 = formatNParamPatternReverseSuffix(re, "AU_FE_", "_FIRST" + suffix)
|
||||
textBuffer += `#define AU_FOR_EACH${suffix}(action, ...) AU_FE_EXPAND(AU_GET_MACRO${suffix}(_whydoweneedthis, __VA_ARGS__, ${params})(action,__VA_ARGS__))\n`
|
||||
textBuffer += `#define AU_FOR_EACH_FIRST${suffix}(action, ...) AU_FE_EXPAND(AU_GET_MACRO${suffix}(_whydoweneedthis, __VA_ARGS__, ${params2})(action,__VA_ARGS__))`
|
||||
|
||||
textBuffer += "\n\n"
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user