Update comments and error code values

This commit is contained in:
olemorud
2023-04-25 05:05:01 +02:00
parent edfea67b65
commit 47792c624b
3 changed files with 27 additions and 23 deletions

View File

@@ -5,9 +5,9 @@
/*
Number of elements in a hashmap
Hashmaps are implemented as an array
of linked lists. This specifies the
length of the initial array.
Hashmaps are implemented as an array
of linked lists. This specifies the
length of the initial array.
*/
#define OBJ_SIZE 32
@@ -15,25 +15,26 @@
Length of surrounding context to print
on parser errors.
Upon parser errors (e.g. syntax errors
in the JSON file), the program outputs
the surrounding context of the error.
E.g:
| Expected ':' at index 123
| context:
| \n\t\t{ "foo" "bar" },\n\t
| ^
In the above example, ERROR_CONTEXT_LEN
is set to 20.
Upon parser errors (e.g. syntax errors
in the JSON file), the program outputs
the surrounding context of the error.
E.g:
| Expected ':' at index 123
| context:
| \n\t\t{ "foo" "bar" },\n\t
| ^
In the above example, ERROR_CONTEXT_LEN
is set to 20.
*/
#define ERROR_CONTEXT_LEN 60
/*
Error codes
EARLY_EOF - End of file unexpectedly reached
UNEXPECTED_CHAR - Unexpected character encountered
Return codes on different errors:
EARLY_EOF - End of file unexpectedly reached
UNEXPECTED_CHAR - Unexpected character encountered
*/
#define EARLY_EOF 202
#define UNEXPECTED_CHAR 200
#define EARLY_EOF 200
#define UNEXPECTED_CHAR 201
#endif