Skip to content

Commit

Permalink
Merge branch 'mk/handlerGetRandom' into mk/forLoopMultiVar
Browse files Browse the repository at this point in the history
  • Loading branch information
maximiliankaul committed Sep 25, 2024
2 parents 30a7d1f + 2bade9f commit 523fec2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Name(
* prefixed by [prefix], followed by a separator character [separatorChar] and finalized by
* a random UUID ("-" separators also replaced with [separatorChar]).
*/
fun getRandomTempName(prefix: String, separatorChar: Char = '_'): Name {
fun random(prefix: String, separatorChar: Char = '_'): Name {
val randomPart = Uuid.random().toString().replace('-', separatorChar)
return Name(localName = prefix + separatorChar + randomPart)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class StatementHandler(frontend: PythonLanguageFrontend) :
private fun getDummyAssign(
loopVar: InitializerListExpression
): Pair<Reference, AssignExpression> {
val tempVarName = Name.getRandomTempName(prefix = "loopMultiVarHelperVar")
val tempVarName = Name.random(prefix = "loopMultiVarHelperVar")
val tempRef = newReference(name = tempVarName)
tempRef.isImplicit = true
val assign =
Expand Down

0 comments on commit 523fec2

Please sign in to comment.