You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"there is no automatic rewrite because the compiler cannot prove the source text is ASCII or recover C# overload semantics from the method name alone",
message:"C# `String.IndexOf` needs an explicit index-model review",
373
+
primary_label:"SplitScript returns an optional UTF-8 byte offset",
374
+
notes:&[
375
+
"rewrite an ordinal ASCII search as `text.indexOf(substring)` and handle `None` instead of comparing the result with C#'s `-1` sentinel",
376
+
"SplitScript offsets count UTF-8 bytes; C# string offsets count UTF-16 code units, so copied arithmetic is only equivalent for proven ASCII text",
377
+
"comparison-mode and start-index overloads need separate review; the canonical operation is exact and case-sensitive from the beginning of the string",
378
+
"there is no automatic rewrite because changing both the index unit and absence representation can require surrounding control-flow changes",
Copy file name to clipboardExpand all lines: docs/MIGRATION_CAPABILITIES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ This index maps common source-language concepts to canonical SplitScript APIs an
13
13
|`string.equality` — String equality | C# | Supported directly | Use `==` or `!=` for exact string content equality; use `equalsIgnoreAsciiCase` only when ASCII-insensitive matching is intended. Canonical targets: `String`, `String.equalsIgnoreAsciiCase`. [Recipe](ASL_PORTING.md#c-string-operations). |
14
14
|`operator.strict-equality` — Strict equality operators | JavaScript | Supported directly | Use typed `==` and `!=`; SplitScript has no coercing equality operators, so JavaScript's extra `=` is unnecessary. Canonical targets: `==`, `!=`. |
15
15
|`string.substring` — Substring extraction | C# | Use a typed pattern | Use fallible `slice(start, exclusiveEnd)` only after translating C#'s length argument and verifying that UTF-16 source positions are valid UTF-8 byte offsets. Canonical targets: `String.slice`. [Recipe](ASL_PORTING.md#c-string-operations). |
16
+
|`string.index-of` — Substring position | C# | Use a typed pattern | Use `indexOf` for an optional UTF-8 byte offset; review C# UTF-16 index arithmetic and replace the `-1` sentinel with Option handling. Canonical targets: `String.indexOf`. [Recipe](ASL_PORTING.md#c-string-operations). |
16
17
|`string.numeric-parse` — Numeric string parsing | C# | Supported directly | Replace static Parse/TryParse calls and output parameters with fallible `text.parse()` and ordinary Result handling. Canonical targets: `String.parse`. [Recipe](ASL_PORTING.md#c-string-operations). |
17
18
|`type.duration` — Timer durations | C# | Supported directly | Use `Duration` instead of C#'s `TimeSpan`. Canonical targets: `Duration`. |
18
19
|`duration.parse` — Text duration parsing | C# | Use a typed pattern | Replace `TimeSpan.Parse` according to whether the input is fixed data or an already-typed timer value; do not preserve culture-sensitive parsing by default. Canonical targets: `Duration.fromWholeSeconds`, `Duration.fromWholeMilliseconds`, `Duration.fromParts`. |
0 commit comments