klyn.code.CodeTokenizer.scanEscapeEnd
method
public static scanEscapeEnd(line as String, index as Long, limit as Long) as Long
Description

Scans a backslash escape sequence starting at index (where line[index] == '\\') up to limit.

Parameters
ParameterDescription
lineSource line text.
indexIndex of the leading backslash \.
limitExclusive upper bound of the enclosing literal.
Returns

Exclusive end index of the valid escape sequence, or -1 if not a valid escape.

Example
import klyn.code

assert CodeTokenizer.scanEscapeEnd("\\u0041", 0, 6) == 6
assert CodeTokenizer.scanEscapeEnd("\\n", 0, 2) == 2