Skip to content

Conversation

terriblegoodday
Copy link

@terriblegoodday terriblegoodday commented Oct 1, 2025

The stringLiteralWithQuotes had some leftover Kotlin string escaping logic that had to be cleaned up:

  1. Dollar sign escaping: in Swift, the dollar sign should not be escaped as $${'$'} – this
    breaks emitting the intended string literal.
  2. .trimMargin doesn’t exist for Swift multiline strings, so the code would fail to compile if
    we attempted something like that.
  3. Multiline literals in Swift should be formatted as:
"""
abc();
def();
"""

Not

"""
|abc();
|def();
""".trimMargin()

Before:

€\t@\t${'$'} -> "€\\t@\\t${'$'}{'${'$'}'}"

"\"ab$c();\\ndef();\"" -> "\"ab${'$'}c();\\ndef();\""

"abc();\ndef();" -> """
|abc();
|def();
""".trimMargin()

After:

€\t@\t${'$'} -> "€\\t@\\t${'$'}"

"\"ab$c();\\ndef();\"" -> "\"ab$c();\\ndef();\""

"abc();\ndef();" -> """
abc();
def();
"""

@terriblegoodday
Copy link
Author

Force pushed fixed indent for stringLiteralWithQuotes, ./gradlew check should pass now.

@kdubb
Copy link
Contributor

kdubb commented Oct 17, 2025

@terriblegoodday Thank you... I was trying to use GitHub's web interface to "quickly" fix them last night haha

@kdubb kdubb force-pushed the fix/string-literals branch from f709ade to ac9bc8b Compare October 17, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants