public static scanEscapeEnd(line as String, index as Long, limit as Long) as Long
Scans a backslash escape sequence starting at index (where line[index] == '\\') up to limit.
| Parameter | Description |
|---|---|
line | Source line text. |
index | Index of the leading backslash \. |
limit | Exclusive upper bound of the enclosing literal. |
Exclusive end index of the valid escape sequence, or -1 if not a valid escape.
import klyn.code
assert CodeTokenizer.scanEscapeEnd("\\u0041", 0, 6) == 6
assert CodeTokenizer.scanEscapeEnd("\\n", 0, 2) == 2