Skip to content

Commit 6a29878

Browse files
gemini-clilens0021
authored andcommitted
Combine escaping-related sections into a single section
1 parent 04bf53c commit 6a29878

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

docs/0.5.0-alpha/getting_started/migration_guide.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,15 @@ if my_text == "true" {
128128
}
129129
```
130130

131-
# String Literal Escaping Changes <!-- #594 -->
132131

133-
A bug related to the escaping of `$` sequences within string literals has been fixed. Previously, `"\\$variable"` would incorrectly interpolate the value of `variable` instead of treating `$` as a literal character. If your code inadvertently relied on the previous buggy behavior where `\$` within a string literal was interpolated, you will now observe the correct behavior where `\$` is treated as a literal dollar sign. You may need to adjust your string literals if you intended interpolation in such cases.
132+
133+
134+
135+
# Escaping Changes
136+
137+
## String Literal Escaping Changes <!-- #594 -->
138+
139+
A bug related to the escaping of `$` sequences within string literals has been fixed. Previously, `"\$variable"` would incorrectly interpolate the value of `variable` instead of treating `$` as a literal character. If your code inadvertently relied on the previous buggy behavior where `\$` within a string literal was interpolated, you will now observe the correct behavior where `\$` is treated as a literal dollar sign. You may need to adjust your string literals if you intended interpolation in such cases.
134140

135141
**Before (Buggy Behavior):**
136142
```ab
@@ -148,15 +154,15 @@ fun print_var(var: Int): Null {
148154
print_var(45) // Output: \$var (literal dollar sign)
149155
```
150156

151-
# Invalid Escape Sequence Warnings <!-- #732 -->
157+
## Invalid Escape Sequence Warnings <!-- #732 -->
152158

153159
The compiler now issues warnings for invalid escape sequences within string literals. While this does not prevent compilation or change the runtime behavior of your scripts (invalid sequences are still output literally), it helps identify potential mistakes and encourages the use of valid escape sequences. If your build process treats warnings as errors, you may need to address these warnings by correcting the escape sequences or explicitly escaping backslashes.
154160

155161
```ab
156162
echo "Hello \$ World" // This will now produce a warning
157163
```
158164

159-
# Command String Escaping Changes <!-- #772 -->
165+
## Command String Escaping Changes <!-- #772 -->
160166

161167
The internal handling of text within commands has been refactored, leading to a breaking change in how double quotes (`"`) should be escaped within command strings. Previously, `"` might have been escaped with `\"` in some contexts, but this is no longer the correct behavior.
162168

0 commit comments

Comments
 (0)