1- From 4c133fe5adfe4b8ccdd8b014d884b685143b9e66 Mon Sep 17 00:00:00 2001
1+ From 0cd2add6c46400b808329442f81451b369863983 Mon Sep 17 00:00:00 2001
22From: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
33Date: Sat, 26 Aug 2023 15:08:59 +0200
44Subject: [PATCH 1/6] Expose line and column information for use in PHP
@@ -15,10 +15,10 @@ Subject: [PATCH 1/6] Expose line and column information for use in PHP
1515 8 files changed, 48 insertions(+), 5 deletions(-)
1616
1717diff --git a/source/lexbor/dom/interfaces/node.h b/source/lexbor/dom/interfaces/node.h
18- index b052cf5..b5d2c50 100644
18+ index 6c74ac5..b95373c 100644
1919--- a/source/lexbor/dom/interfaces/node.h
2020+++ b/source/lexbor/dom/interfaces/node.h
21- @@ -83 ,6 +83 ,8 @@ struct lxb_dom_node {
21+ @@ -86 ,6 +86 ,8 @@ struct lxb_dom_node {
2222
2323 lxb_dom_node_type_t type;
2424
@@ -41,18 +41,18 @@ index 79accd0..0b7f4fd 100644
4141 const lxb_char_t *text_start;
4242 const lxb_char_t *text_end;
4343diff --git a/source/lexbor/html/tokenizer.c b/source/lexbor/html/tokenizer.c
44- index 741bced..0bd9aec 100644
44+ index 22b88ed..1d9f378 100644
4545--- a/source/lexbor/html/tokenizer.c
4646+++ b/source/lexbor/html/tokenizer.c
47- @@ -91 ,6 +91 ,7 @@ lxb_html_tokenizer_init(lxb_html_tokenizer_t *tkz)
47+ @@ -92 ,6 +92 ,7 @@ lxb_html_tokenizer_init(lxb_html_tokenizer_t *tkz)
4848
4949 tkz->pos = tkz->start;
5050 tkz->end = tkz->start + LXB_HTML_TKZ_TEMP_SIZE;
5151+ /* current_line & current_column already initialized by calloc (zero-based) */
5252
5353 tkz->tree = NULL;
5454 tkz->tags = NULL;
55- @@ -152 ,6 +153 ,8 @@ lxb_html_tokenizer_inherit(lxb_html_tokenizer_t *tkz_to,
55+ @@ -153 ,6 +154 ,8 @@ lxb_html_tokenizer_inherit(lxb_html_tokenizer_t *tkz_to,
5656 tkz_to->start = tkz_from->start;
5757 tkz_to->end = tkz_from->end;
5858 tkz_to->pos = tkz_to->start;
@@ -61,7 +61,7 @@ index 741bced..0bd9aec 100644
6161
6262 return LXB_STATUS_OK;
6363 }
64- @@ -312 ,7 +315 ,26 @@ lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data,
64+ @@ -571 ,7 +574 ,26 @@ lxb_html_tokenizer_chunk(lxb_html_tokenizer_t *tkz, const lxb_char_t *data,
6565 tkz->last = end;
6666
6767 while (data < end) {
@@ -90,10 +90,10 @@ index 741bced..0bd9aec 100644
9090
9191 return tkz->status;
9292diff --git a/source/lexbor/html/tokenizer.h b/source/lexbor/html/tokenizer.h
93- index ba9602f..74bb55e 100644
93+ index 12b7c81..aa1ac37 100644
9494--- a/source/lexbor/html/tokenizer.h
9595+++ b/source/lexbor/html/tokenizer.h
96- @@ -73 ,6 +73 ,8 @@ struct lxb_html_tokenizer {
96+ @@ -79 ,6 +79 ,8 @@ struct lxb_html_tokenizer {
9797 const lxb_char_t *end;
9898 const lxb_char_t *begin;
9999 const lxb_char_t *last;
@@ -103,7 +103,7 @@ index ba9602f..74bb55e 100644
103103 /* Entities */
104104 const lexbor_sbst_entry_static_t *entity;
105105diff --git a/source/lexbor/html/tokenizer/state.h b/source/lexbor/html/tokenizer/state.h
106- index 17939b9..5b095b4 100644
106+ index 5e91444..52eaa9a 100644
107107--- a/source/lexbor/html/tokenizer/state.h
108108+++ b/source/lexbor/html/tokenizer/state.h
109109@@ -90,6 +90,8 @@ extern "C" {
@@ -116,10 +116,10 @@ index 17939b9..5b095b4 100644
116116 while (0)
117117
118118diff --git a/source/lexbor/html/tree.c b/source/lexbor/html/tree.c
119- index ece26e9..91bfd17 100644
119+ index 062ea56..3f4c18d 100644
120120--- a/source/lexbor/html/tree.c
121121+++ b/source/lexbor/html/tree.c
122- @@ -427 ,6 +427 ,9 @@ lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree,
122+ @@ -431 ,6 +431 ,9 @@ lxb_html_tree_create_element_for_token(lxb_html_tree_t *tree,
123123 return NULL;
124124 }
125125
@@ -129,7 +129,7 @@ index ece26e9..91bfd17 100644
129129 lxb_status_t status;
130130 lxb_dom_element_t *element = lxb_dom_interface_element(node);
131131
132- @@ -763 ,6 +766 ,11 @@ lxb_html_tree_insert_character_for_data(lxb_html_tree_t *tree,
132+ @@ -767 ,6 +770 ,11 @@ lxb_html_tree_insert_character_for_data(lxb_html_tree_t *tree,
133133
134134 lxb_dom_interface_text(text)->char_data.data = *str;
135135
@@ -141,7 +141,7 @@ index ece26e9..91bfd17 100644
141141 if (ret_node != NULL) {
142142 *ret_node = text;
143143 }
144- @@ -802 ,6 +810 ,9 @@ lxb_html_tree_insert_comment(lxb_html_tree_t *tree,
144+ @@ -806 ,6 +814 ,9 @@ lxb_html_tree_insert_comment(lxb_html_tree_t *tree,
145145 return NULL;
146146 }
147147
@@ -152,10 +152,10 @@ index ece26e9..91bfd17 100644
152152 tree->document->dom_document.text);
153153 if (tree->status != LXB_STATUS_OK) {
154154diff --git a/source/lexbor/html/tree/error.c b/source/lexbor/html/tree/error.c
155- index e6e43f4..88ad8c4 100644
155+ index ffdc55c..ef36eab 100644
156156--- a/source/lexbor/html/tree/error.c
157157+++ b/source/lexbor/html/tree/error.c
158- @@ -21 ,8 +21 ,9 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors,
158+ @@ -22 ,8 +22 ,9 @@ lxb_html_tree_error_add(lexbor_array_obj_t *parse_errors,
159159 }
160160
161161 entry->id = id;
@@ -168,10 +168,10 @@ index e6e43f4..88ad8c4 100644
168168 return entry;
169169 }
170170diff --git a/source/lexbor/html/tree/error.h b/source/lexbor/html/tree/error.h
171- index 2fd06cb..ed1859f 100644
171+ index 7a212af..b186772 100644
172172--- a/source/lexbor/html/tree/error.h
173173+++ b/source/lexbor/html/tree/error.h
174- @@ -97 ,8 +97 ,9 @@ lxb_html_tree_error_id_t;
174+ @@ -109 ,8 +109 ,9 @@ lxb_html_tree_error_id_t;
175175
176176 typedef struct {
177177 lxb_html_tree_error_id_t id;
@@ -184,5 +184,5 @@ index 2fd06cb..ed1859f 100644
184184 lxb_html_tree_error_t;
185185
186186- -
187- 2.49.0
187+ 2.51.2
188188
0 commit comments