| 21 | unsigned int IsEmpty(){ return !!empty; } |
| 22 | |
| 23 | const char* GetErrorString() const |
| 24 | { |
| 25 | if(!lineNum) |
| 26 | return errLocal; |
| 27 | char *curr = errGlobal; |
| 28 | if(lineNum != 0) |
| 29 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "line %d - ", lineNum); |
| 30 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "%s", errLocal); |
| 31 | if(line[0] != 0) |
| 32 | { |
| 33 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "\r\n at \"%s\"", line); |
| 34 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "\r\n "); |
| 35 | if((unsigned)(NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal)) > shift) |
| 36 | { |
| 37 | for(unsigned int i = 0; i < shift; i++) |
| 38 | *(curr++) = ' '; |
| 39 | } |
| 40 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "^"); |
| 41 | } |
| 42 | curr += SafeSprintf(curr, NULLC_ERROR_BUFFER_SIZE - int(curr - errGlobal), "\r\n"); |
| 43 | return errGlobal; |
| 44 | } |
| 45 | static const char *codeStart, *codeEnd; |
| 46 | private: |
| 47 | friend class Compiler; |
no test coverage detected