descape method

String descape(
  1. int pos,
  2. String s
)
inherited

Implementation

String descape(int pos, String s) {
  int i = 0;
  int x = 0;

  while (i < 4) {
    final n = _HexChars[s.codeUnitAt(i)];

    if (n < 0) {
      die(pos, 'expected valid unicode escape');
    }

    x = (x << 4) | n;
    i += 1;
  }

  return String.fromCharCode(x);
}