code: function emitToken(tokenKind, startPos, emitFn) {
                  var tokenStartPos = ts.skipTrivia(currentText, startPos);
                  emitPos(tokenStartPos);
                  var tokenString = ts.tokenToString(tokenKind);
                  if (emitFn) {
                      emitFn();
                  }
                  else {
                      write(tokenString);
                  }
                  var tokenEndPos = tokenStartPos + tokenString.length;
                  emitPos(tokenEndPos);
                  return tokenEndPos;
              }
docs: Emit the text for the given token that comes after startPos
  This by default writes the text provided with the given tokenKind
  but if optional emitFn callback is provided the text is emitted using the callback instead of default text
  @param tokenKind the kind of the token to search and emit
  @param startPos the position in the source to start searching for the token
  @param emitFn if given will be invoked to emit the text instead of actual token emit