code: function (char) {
                  var
                      result;
                  if (this._stopMatching) {
                      return this._lastResult;
                  }
                  ++this._totalLength;
                  result = this._patternItem.write(this._state, char);
                  if (0 < result) {
                      this._lastResult = this._totalLength;
                      this._stopMatching =
                          bitTest(result, PatternItem.WRITE_PATTERN_END);
                  } else if (PatternItem.WRITE_NO_MATCH === result) {
                      this._stopMatching = true;
                      if (0 === this._lastResult) {
                          this._lastResult = -1;
                      }
                  }
                  return this._lastResult;
              }
docs: region ITokenizer 
  @implements gpf.interfaces.ITokenizer:write