function parseModel(val: string): Object {
  str = val
  len = str.length
  index = expressionPos = expressionEndPos = 0

  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
    return {
      exp: val,
      idx: null,
    }
  }

  while (!eof()) {
    chr = next()
    /* istanbul ignore if */
    if (isStringStart(chr)) {
      parseString(chr)
    } else if (chr === 0x5b) {
      parseBracket(chr)
    }
  }

  return {
    exp: val.substring(0, expressionPos),
    idx: val.substring(expressionPos + 1, expressionEndPos),
  }
}
parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)

for loop possible cases:

- test
- test[idx]
- test[test1[idx]]
- test["a"][idx]
- xxx.test[a[a].test1[idx]]
- test.xxx.a["asa"][test1[idx]]