Created
May 24, 2017 08:39
-
-
Save spoenemann/877a0eb30289b216b82ab8977eb8881e to your computer and use it in GitHub Desktop.
Example code that constructs a traced generator subtree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val n = trace(expression) | |
val receiverVar = expression.receiver?.generateExpression(n, scope) | |
val resultVar = scope.nextVarName | |
n.append(generateType(expression.feature?.type)) | |
n.append(' ') | |
n.append(resultVar) | |
... | |
n.append(' = ') | |
n.append(receiverVar ?: 'this') | |
n.append('->') | |
n.append(feature.name) | |
... | |
n.append(';') | |
parent.append(n) | |
parent.appendNewLine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment