scan = () => {
    let idx = 0;
    let tmp = '';

    function clearTmp() {
      if (tmp) {
        parseList.push(tmp);
        tmp = '';
      }
    }

    while (idx < jsonStr.length) {
      const char = jsonStr[idx];
      if (char === '{') {
        if (tmp + char === keyword) {
          parseList.push(tmp + char);
          tmp = '';
        } else {
          clearTmp();
          parseList.push(char);
        }
      } else if (char === '}') {
        clearTmp();
        parseList.push(char);
      } else {
        tmp += char;
      }
      idx++;
    }
  }
'{"$ref":{"foo": "bar"}}' => ['{', '"$ref":{', '"foo": "bar"','}', '}']