1 /* 2 * Copyright (C) 2018-2019 Alexander Borisov 3 * 4 * Author: Alexander Borisov <borisov@lexbor.com> 5 */ 6 7 #ifndef LEXBOR_CSS_SYNTAX_TOKENIZER_ERROR_H 8 #define LEXBOR_CSS_SYNTAX_TOKENIZER_ERROR_H 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #include "lexbor/core/base.h" 15 #include "lexbor/core/array_obj.h" 16 17 18 typedef enum { 19 /* unexpected-eof */ 20 LXB_CSS_SYNTAX_TOKENIZER_ERROR_UNEOF = 0x0000, 21 /* eof-in-comment */ 22 LXB_CSS_SYNTAX_TOKENIZER_ERROR_EOINCO, 23 /* eof-in-string */ 24 LXB_CSS_SYNTAX_TOKENIZER_ERROR_EOINST, 25 /* eof-in-url */ 26 LXB_CSS_SYNTAX_TOKENIZER_ERROR_EOINUR, 27 /* qo-in-url */ 28 LXB_CSS_SYNTAX_TOKENIZER_ERROR_QOINUR, 29 /* wrong-escape-in-url */ 30 LXB_CSS_SYNTAX_TOKENIZER_ERROR_WRESINUR, 31 /* newline-in-string */ 32 LXB_CSS_SYNTAX_TOKENIZER_ERROR_NEINST, 33 /* bad-char */ 34 LXB_CSS_SYNTAX_TOKENIZER_ERROR_BACH, 35 /* bad-code-point */ 36 LXB_CSS_SYNTAX_TOKENIZER_ERROR_BACOPO, 37 } 38 lxb_css_syntax_tokenizer_error_id_t; 39 40 typedef struct { 41 const lxb_char_t *pos; 42 lxb_css_syntax_tokenizer_error_id_t id; 43 } 44 lxb_css_syntax_tokenizer_error_t; 45 46 47 LXB_API lxb_css_syntax_tokenizer_error_t * 48 lxb_css_syntax_tokenizer_error_add(lexbor_array_obj_t *parse_errors, 49 const lxb_char_t *pos, 50 lxb_css_syntax_tokenizer_error_id_t id); 51 52 53 #ifdef __cplusplus 54 } /* extern "C" */ 55 #endif 56 57 #endif /* LEXBOR_CSS_SYNTAX_TOKENIZER_ERROR_H */ 58 59