/* * GetFind - get a find location */ vi_rc GetFind( char *st, i_mark *pos1, int *len1, find_type flags ) { int len; char *linedata; i_mark pos2; vi_rc rc; /* * do find */ if( CurrentFile == NULL ) { return( ERR_NO_FILE ); } rc = setLineCol( st, &pos2, flags ); if( rc == ERR_NO_ERR ) { if( flags & FINDFL_FORWARD ) { rc = FindRegularExpression( sStr, &pos2, &linedata, MAX_LONG, flags ); } else { rc = FindRegularExpressionBackwards( sStr, &pos2, &linedata, -1, flags ); } } lastPosInfo = CurrentInfo; /* * process results */ if( rc == ERR_NO_ERR ) { if( linedata[pos2.column] == 0 ) { pos2.column--; } len = GetCurrRegExpLength(); lastPos = pos2; *pos1 = pos2; *len1 = len; } else { if( rc == ERR_FIND_NOT_FOUND || rc == ERR_FIND_END_OF_FILE || rc == ERR_FIND_TOP_OF_FILE ) { if( !(flags & FINDFL_NOERROR) ) { Error( GetErrorMsg( rc ), sStr ); rc = DO_NOT_CLEAR_MESSAGE_WINDOW; } if( flags & FINDFL_FORWARD ) { lastPos.column -= 1; } else { lastPos.column += 1; } lastPos.line = CurrentPos.line; } } return( rc ); } /* GetFind */
std::string Tokenizer::generateErrorMessage(std::string message) { setLineCol(); return stringFormat("[Error] " + message + " at line %d col %d", line, col); }
Comida::Comida(int i1, int j1){ //construtor setLineCol(i1,j1); }
Pedaco::Pedaco(int i1, int j1){ //construtor setLineCol(i1,j1); next = NULL; }