Repository navigation
Commit e5a4dc0
committed
fix(php): keep PHP after comment-ended close tags, CR comments and bare short tags
Addresses CodeRabbit review on PR #34 (internal/cbm/php_inline_html.c and
two test findings).
Inline-HTML masker:
- Line comments now end at a lone CR as well as LF, so CR-only files do
not scan into the next line and treat `?>` inside a string as a close
tag.
- A `?>` that ends a `//` or `#` comment used to become `; ` with the
comment still open, hiding PHP reopened on the same line. The comment
bytes up to the close tag are now blanked to spaces. Byte offsets and
rows are unchanged; only that comment's text is lost to the parser.
- With short tags, `<?` followed directly by an identifier (`<?work();`)
now opens PHP. `<?xml` prologs stay markup.
Tests:
- test_daemon_application: two worker resource-failure tests reused
th_mktempdir's static buffer for cache and root, so cleanup removed the
root twice and leaked the cache directory. Both paths are now copied.
- test_pipeline: swift_init_observe leaves init_usages at -1 unless the
USAGE query succeeds, so a failed query fails the test.
- test_extraction: php_inline_html_comment_close_tag_and_short_tag_masks
checks exact mask output for these cases and that a function reopened
after a comment-ended close tag is extracted.1 parent 96a1ac5 commit e5a4dc0
4 files changed
Lines changed: 80 additions & 13 deletions
File tree
- internal/cbm
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
83 | 90 | | |
84 | | - | |
85 | | - | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
101 | 113 | | |
102 | 114 | | |
103 | 115 | | |
| |||
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
144 | | - | |
| 156 | + | |
145 | 157 | | |
146 | 158 | | |
147 | 159 | | |
| |||
236 | 248 | | |
237 | 249 | | |
238 | 250 | | |
239 | | - | |
| 251 | + | |
| 252 | + | |
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
| |||
247 | 260 | | |
248 | 261 | | |
249 | 262 | | |
| 263 | + | |
250 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
251 | 268 | | |
252 | 269 | | |
253 | 270 | | |
| |||
295 | 312 | | |
296 | 313 | | |
297 | 314 | | |
298 | | - | |
299 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
300 | 319 | | |
301 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
302 | 324 | | |
303 | 325 | | |
304 | 326 | | |
| |||
336 | 358 | | |
337 | 359 | | |
338 | 360 | | |
339 | | - | |
| 361 | + | |
| 362 | + | |
340 | 363 | | |
341 | 364 | | |
342 | 365 | | |
343 | | - | |
| 366 | + | |
344 | 367 | | |
345 | 368 | | |
346 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
2777 | | - | |
| 2777 | + | |
| 2778 | + | |
| 2779 | + | |
2778 | 2780 | | |
2779 | 2781 | | |
2780 | 2782 | | |
| |||
2799 | 2801 | | |
2800 | 2802 | | |
2801 | 2803 | | |
2802 | | - | |
| 2804 | + | |
| 2805 | + | |
2803 | 2806 | | |
2804 | 2807 | | |
2805 | 2808 | | |
| |||
2847 | 2850 | | |
2848 | 2851 | | |
2849 | 2852 | | |
| 2853 | + | |
| 2854 | + | |
2850 | 2855 | | |
2851 | 2856 | | |
2852 | 2857 | | |
| |||
2858 | 2863 | | |
2859 | 2864 | | |
2860 | 2865 | | |
2861 | | - | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
2862 | 2869 | | |
2863 | 2870 | | |
2864 | 2871 | | |
| |||
2887 | 2894 | | |
2888 | 2895 | | |
2889 | 2896 | | |
2890 | | - | |
| 2897 | + | |
| 2898 | + | |
2891 | 2899 | | |
2892 | 2900 | | |
2893 | 2901 | | |
| |||
2935 | 2943 | | |
2936 | 2944 | | |
2937 | 2945 | | |
| 2946 | + | |
| 2947 | + | |
2938 | 2948 | | |
2939 | 2949 | | |
2940 | 2950 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1110 | 1110 | | |
1111 | 1111 | | |
1112 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1113 | 1144 | | |
1114 | 1145 | | |
1115 | 1146 | | |
| |||
15448 | 15479 | | |
15449 | 15480 | | |
15450 | 15481 | | |
| 15482 | + | |
15451 | 15483 | | |
15452 | 15484 | | |
15453 | 15485 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23126 | 23126 | | |
23127 | 23127 | | |
23128 | 23128 | | |
23129 | | - | |
| 23129 | + | |
23130 | 23130 | | |
| 23131 | + | |
23131 | 23132 | | |
23132 | 23133 | | |
23133 | 23134 | | |
| |||
23148 | 23149 | | |
23149 | 23150 | | |
23150 | 23151 | | |
| 23152 | + | |
23151 | 23153 | | |
23152 | 23154 | | |
23153 | 23155 | | |
| |||
0 commit comments