-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy patherrors.h
40 lines (34 loc) · 935 Bytes
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef ERRORS_H
#define ERRORS_H
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
typedef enum {
ERROR_EndlessString = 1,
ERROR_FunctionPlacement,
ERROR_IncompatibleTypes,
ERROR_UnexpectedIndent,
ERROR_AssignToLiteral,
ERROR_UnrecognizedSymbol,
ERROR_UndefinedVerb,
ERROR_UndefinedVariable,
ERROR_UndefinedType,
ERROR_CannotAllocateMemory,
ERROR_InvalidArguments,
ERROR_ParseError,
ERROR_RuntimeError
} ErrorCode;
int g_lineNum;
int g_lineCol;
int g_headerLines;
int errorMsg(const char *format, ...);
int warningMsg(const char *format, ...);
void criticalError(ErrorCode code, char *message);
#endif