herb 0.10.1 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (793) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +17 -7
  3. data/README.md +36 -119
  4. data/Rakefile +2 -11
  5. data/config/action_view_helpers/actioncable/action_cable_helper/action_cable_meta_tag.yml +12 -8
  6. data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy?.yml +9 -6
  7. data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy_nonce.yml +9 -6
  8. data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_path.yml +20 -12
  9. data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_url.yml +30 -18
  10. data/config/action_view_helpers/actionpack/request_forgery_protection/form_authenticity_token.yml +15 -9
  11. data/config/action_view_helpers/actionpack/request_forgery_protection/protect_against_forgery?.yml +9 -6
  12. data/config/action_view_helpers/actiontext/content_helper/render_action_text_content.yml +15 -9
  13. data/config/action_view_helpers/actiontext/content_helper/sanitize_action_text_content.yml +15 -9
  14. data/config/action_view_helpers/actiontext/tag_helper/rich_textarea_tag.yml +34 -22
  15. data/config/action_view_helpers/actionview/active_model_helper/error_message.yml +9 -6
  16. data/config/action_view_helpers/actionview/active_model_helper/error_wrapping.yml +9 -6
  17. data/config/action_view_helpers/actionview/active_model_helper/object.yml +9 -6
  18. data/config/action_view_helpers/actionview/asset_tag_helper/apply_stylesheet_media_default.yml +9 -6
  19. data/config/action_view_helpers/actionview/asset_tag_helper/audio_tag.yml +40 -27
  20. data/config/action_view_helpers/actionview/asset_tag_helper/auto_discovery_link_tag.yml +37 -23
  21. data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce.yml +9 -6
  22. data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_scripts.yml +9 -6
  23. data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_styles.yml +9 -6
  24. data/config/action_view_helpers/actionview/asset_tag_helper/favicon_link_tag.yml +32 -22
  25. data/config/action_view_helpers/actionview/asset_tag_helper/image_decoding.yml +9 -6
  26. data/config/action_view_helpers/actionview/asset_tag_helper/image_loading.yml +9 -6
  27. data/config/action_view_helpers/actionview/asset_tag_helper/image_tag.yml +67 -46
  28. data/config/action_view_helpers/actionview/asset_tag_helper/javascript_include_tag.yml +58 -39
  29. data/config/action_view_helpers/actionview/asset_tag_helper/picture_tag.yml +22 -14
  30. data/config/action_view_helpers/actionview/asset_tag_helper/preload_link_tag.yml +45 -30
  31. data/config/action_view_helpers/actionview/asset_tag_helper/preload_links_header.yml +9 -6
  32. data/config/action_view_helpers/actionview/asset_tag_helper/stylesheet_link_tag.yml +49 -30
  33. data/config/action_view_helpers/actionview/asset_tag_helper/video_tag.yml +53 -35
  34. data/config/action_view_helpers/actionview/asset_url_helper/asset_path.yml +16 -10
  35. data/config/action_view_helpers/actionview/asset_url_helper/asset_url.yml +16 -10
  36. data/config/action_view_helpers/actionview/asset_url_helper/audio_path.yml +16 -10
  37. data/config/action_view_helpers/actionview/asset_url_helper/audio_url.yml +16 -10
  38. data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_extname.yml +9 -6
  39. data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_host.yml +9 -6
  40. data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_path.yml +9 -6
  41. data/config/action_view_helpers/actionview/asset_url_helper/font_path.yml +16 -10
  42. data/config/action_view_helpers/actionview/asset_url_helper/font_url.yml +16 -10
  43. data/config/action_view_helpers/actionview/asset_url_helper/image_path.yml +16 -10
  44. data/config/action_view_helpers/actionview/asset_url_helper/image_url.yml +16 -10
  45. data/config/action_view_helpers/actionview/asset_url_helper/javascript_path.yml +16 -10
  46. data/config/action_view_helpers/actionview/asset_url_helper/javascript_url.yml +16 -10
  47. data/config/action_view_helpers/actionview/asset_url_helper/public_compute_asset_path.yml +9 -6
  48. data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_path.yml +16 -10
  49. data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_url.yml +16 -10
  50. data/config/action_view_helpers/actionview/asset_url_helper/video_path.yml +16 -10
  51. data/config/action_view_helpers/actionview/asset_url_helper/video_url.yml +16 -10
  52. data/config/action_view_helpers/actionview/atom_feed_helper/atom_feed.yml +52 -27
  53. data/config/action_view_helpers/actionview/cache_helper/cache.yml +25 -15
  54. data/config/action_view_helpers/actionview/cache_helper/cache_fragment_name.yml +9 -6
  55. data/config/action_view_helpers/actionview/cache_helper/cache_if.yml +20 -12
  56. data/config/action_view_helpers/actionview/cache_helper/cache_unless.yml +20 -12
  57. data/config/action_view_helpers/actionview/cache_helper/caching_predicate.yml +9 -6
  58. data/config/action_view_helpers/actionview/cache_helper/digest_path_from_template.yml +9 -6
  59. data/config/action_view_helpers/actionview/cache_helper/fragment_for.yml +9 -6
  60. data/config/action_view_helpers/actionview/cache_helper/fragment_name_with_digest.yml +9 -6
  61. data/config/action_view_helpers/actionview/cache_helper/read_fragment_for.yml +9 -6
  62. data/config/action_view_helpers/actionview/cache_helper/uncacheable.yml +9 -6
  63. data/config/action_view_helpers/actionview/cache_helper/write_fragment_for.yml +9 -6
  64. data/config/action_view_helpers/actionview/capture_helper/capture.yml +9 -6
  65. data/config/action_view_helpers/actionview/capture_helper/content_for.yml +20 -12
  66. data/config/action_view_helpers/actionview/capture_helper/content_for_predicate.yml +15 -9
  67. data/config/action_view_helpers/actionview/capture_helper/provide.yml +15 -9
  68. data/config/action_view_helpers/actionview/capture_helper/with_output_buffer.yml +9 -6
  69. data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prepend_content_exfiltration_prevention.yml +9 -6
  70. data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prevent_content_exfiltration.yml +9 -6
  71. data/config/action_view_helpers/actionview/controller_helper/action_name.yml +9 -6
  72. data/config/action_view_helpers/actionview/controller_helper/assign_controller.yml +9 -6
  73. data/config/action_view_helpers/actionview/controller_helper/controller.yml +9 -6
  74. data/config/action_view_helpers/actionview/controller_helper/controller_name.yml +9 -6
  75. data/config/action_view_helpers/actionview/controller_helper/controller_path.yml +9 -6
  76. data/config/action_view_helpers/actionview/controller_helper/cookies.yml +9 -6
  77. data/config/action_view_helpers/actionview/controller_helper/flash.yml +9 -6
  78. data/config/action_view_helpers/actionview/controller_helper/headers.yml +9 -6
  79. data/config/action_view_helpers/actionview/controller_helper/logger.yml +9 -6
  80. data/config/action_view_helpers/actionview/controller_helper/params.yml +9 -6
  81. data/config/action_view_helpers/actionview/controller_helper/request.yml +9 -6
  82. data/config/action_view_helpers/actionview/controller_helper/request_forgery_protection_token.yml +9 -6
  83. data/config/action_view_helpers/actionview/controller_helper/response.yml +9 -6
  84. data/config/action_view_helpers/actionview/controller_helper/session.yml +9 -6
  85. data/config/action_view_helpers/actionview/csp_helper/csp_meta_tag.yml +18 -11
  86. data/config/action_view_helpers/actionview/csrf_helper/csrf_meta_tags.yml +16 -10
  87. data/config/action_view_helpers/actionview/date_helper/date_select.yml +85 -51
  88. data/config/action_view_helpers/actionview/date_helper/datetime_select.yml +65 -39
  89. data/config/action_view_helpers/actionview/date_helper/distance_of_time_in_words.yml +30 -18
  90. data/config/action_view_helpers/actionview/date_helper/relative_time_in_words.yml +35 -21
  91. data/config/action_view_helpers/actionview/date_helper/select_date.yml +50 -30
  92. data/config/action_view_helpers/actionview/date_helper/select_datetime.yml +65 -39
  93. data/config/action_view_helpers/actionview/date_helper/select_day.yml +40 -24
  94. data/config/action_view_helpers/actionview/date_helper/select_hour.yml +50 -30
  95. data/config/action_view_helpers/actionview/date_helper/select_minute.yml +40 -24
  96. data/config/action_view_helpers/actionview/date_helper/select_month.yml +60 -36
  97. data/config/action_view_helpers/actionview/date_helper/select_second.yml +35 -21
  98. data/config/action_view_helpers/actionview/date_helper/select_time.yml +55 -33
  99. data/config/action_view_helpers/actionview/date_helper/select_year.yml +45 -27
  100. data/config/action_view_helpers/actionview/date_helper/time_ago_in_words.yml +21 -13
  101. data/config/action_view_helpers/actionview/date_helper/time_select.yml +60 -36
  102. data/config/action_view_helpers/actionview/date_helper/time_tag.yml +32 -20
  103. data/config/action_view_helpers/actionview/debug_helper/debug.yml +15 -9
  104. data/config/action_view_helpers/actionview/form_builder/button.yml +60 -0
  105. data/config/action_view_helpers/actionview/form_builder/submit.yml +48 -0
  106. data/config/action_view_helpers/actionview/form_helper/apply_form_for_options.yml +9 -6
  107. data/config/action_view_helpers/actionview/form_helper/checkbox.yml +41 -25
  108. data/config/action_view_helpers/actionview/form_helper/color_field.yml +25 -15
  109. data/config/action_view_helpers/actionview/form_helper/date_field.yml +35 -21
  110. data/config/action_view_helpers/actionview/form_helper/datetime_field.yml +41 -25
  111. data/config/action_view_helpers/actionview/form_helper/email_field.yml +25 -15
  112. data/config/action_view_helpers/actionview/form_helper/emitted_hidden_id.yml +9 -6
  113. data/config/action_view_helpers/actionview/form_helper/fields.yml +37 -18
  114. data/config/action_view_helpers/actionview/form_helper/fields_for.yml +33 -15
  115. data/config/action_view_helpers/actionview/form_helper/file_field.yml +45 -27
  116. data/config/action_view_helpers/actionview/form_helper/form_for.yml +45 -24
  117. data/config/action_view_helpers/actionview/form_helper/form_with.yml +56 -30
  118. data/config/action_view_helpers/actionview/form_helper/form_with_generates_ids.yml +9 -6
  119. data/config/action_view_helpers/actionview/form_helper/form_with_generates_remote_forms.yml +9 -6
  120. data/config/action_view_helpers/actionview/form_helper/hidden_field.yml +25 -15
  121. data/config/action_view_helpers/actionview/form_helper/label.yml +52 -27
  122. data/config/action_view_helpers/actionview/form_helper/month_field.yml +25 -15
  123. data/config/action_view_helpers/actionview/form_helper/multipart.yml +9 -6
  124. data/config/action_view_helpers/actionview/form_helper/multiple_file_field_include_hidden.yml +9 -6
  125. data/config/action_view_helpers/actionview/form_helper/number_field.yml +45 -27
  126. data/config/action_view_helpers/actionview/form_helper/password_field.yml +25 -15
  127. data/config/action_view_helpers/actionview/form_helper/radio_button.yml +30 -18
  128. data/config/action_view_helpers/actionview/form_helper/range_field.yml +45 -27
  129. data/config/action_view_helpers/actionview/form_helper/search_field.yml +25 -15
  130. data/config/action_view_helpers/actionview/form_helper/telephone_field.yml +26 -16
  131. data/config/action_view_helpers/actionview/form_helper/text_field.yml +25 -15
  132. data/config/action_view_helpers/actionview/form_helper/textarea.yml +31 -19
  133. data/config/action_view_helpers/actionview/form_helper/time_field.yml +40 -24
  134. data/config/action_view_helpers/actionview/form_helper/url_field.yml +25 -15
  135. data/config/action_view_helpers/actionview/form_helper/week_field.yml +25 -15
  136. data/config/action_view_helpers/actionview/form_options_helper/collection_checkboxes.yml +58 -31
  137. data/config/action_view_helpers/actionview/form_options_helper/collection_radio_buttons.yml +57 -30
  138. data/config/action_view_helpers/actionview/form_options_helper/collection_select.yml +65 -39
  139. data/config/action_view_helpers/actionview/form_options_helper/grouped_collection_select.yml +65 -39
  140. data/config/action_view_helpers/actionview/form_options_helper/grouped_options_for_select.yml +35 -21
  141. data/config/action_view_helpers/actionview/form_options_helper/option_groups_from_collection_for_select.yml +40 -24
  142. data/config/action_view_helpers/actionview/form_options_helper/options_for_select.yml +20 -12
  143. data/config/action_view_helpers/actionview/form_options_helper/options_from_collection_for_select.yml +30 -18
  144. data/config/action_view_helpers/actionview/form_options_helper/select.yml +60 -36
  145. data/config/action_view_helpers/actionview/form_options_helper/time_zone_options_for_select.yml +25 -15
  146. data/config/action_view_helpers/actionview/form_options_helper/time_zone_select.yml +50 -30
  147. data/config/action_view_helpers/actionview/form_options_helper/weekday_options_for_select.yml +30 -18
  148. data/config/action_view_helpers/actionview/form_options_helper/weekday_select.yml +30 -18
  149. data/config/action_view_helpers/actionview/form_tag_helper/button_tag.yml +39 -21
  150. data/config/action_view_helpers/actionview/form_tag_helper/checkbox_tag.yml +33 -21
  151. data/config/action_view_helpers/actionview/form_tag_helper/color_field_tag.yml +26 -17
  152. data/config/action_view_helpers/actionview/form_tag_helper/date_field_tag.yml +27 -17
  153. data/config/action_view_helpers/actionview/form_tag_helper/datetime_field_tag.yml +28 -18
  154. data/config/action_view_helpers/actionview/form_tag_helper/default_enforce_utf8.yml +9 -6
  155. data/config/action_view_helpers/actionview/form_tag_helper/email_field_tag.yml +27 -17
  156. data/config/action_view_helpers/actionview/form_tag_helper/embed_authenticity_token_in_remote_forms.yml +9 -6
  157. data/config/action_view_helpers/actionview/form_tag_helper/field_id.yml +30 -18
  158. data/config/action_view_helpers/actionview/form_tag_helper/field_name.yml +30 -18
  159. data/config/action_view_helpers/actionview/form_tag_helper/field_set_tag.yml +23 -15
  160. data/config/action_view_helpers/actionview/form_tag_helper/file_field_tag.yml +35 -22
  161. data/config/action_view_helpers/actionview/form_tag_helper/form_tag.yml +38 -24
  162. data/config/action_view_helpers/actionview/form_tag_helper/hidden_field_tag.yml +27 -17
  163. data/config/action_view_helpers/actionview/form_tag_helper/image_submit_tag.yml +31 -21
  164. data/config/action_view_helpers/actionview/form_tag_helper/label_tag.yml +33 -17
  165. data/config/action_view_helpers/actionview/form_tag_helper/month_field_tag.yml +27 -17
  166. data/config/action_view_helpers/actionview/form_tag_helper/number_field_tag.yml +47 -29
  167. data/config/action_view_helpers/actionview/form_tag_helper/password_field_tag.yml +27 -17
  168. data/config/action_view_helpers/actionview/form_tag_helper/radio_button_tag.yml +32 -20
  169. data/config/action_view_helpers/actionview/form_tag_helper/range_field_tag.yml +47 -29
  170. data/config/action_view_helpers/actionview/form_tag_helper/search_field_tag.yml +27 -17
  171. data/config/action_view_helpers/actionview/form_tag_helper/select_tag.yml +47 -29
  172. data/config/action_view_helpers/actionview/form_tag_helper/submit_tag.yml +33 -21
  173. data/config/action_view_helpers/actionview/form_tag_helper/telephone_field_tag.yml +28 -18
  174. data/config/action_view_helpers/actionview/form_tag_helper/text_field_tag.yml +27 -17
  175. data/config/action_view_helpers/actionview/form_tag_helper/textarea_tag.yml +31 -20
  176. data/config/action_view_helpers/actionview/form_tag_helper/time_field_tag.yml +27 -17
  177. data/config/action_view_helpers/actionview/form_tag_helper/url_field_tag.yml +27 -17
  178. data/config/action_view_helpers/actionview/form_tag_helper/utf8_enforcer_tag.yml +9 -6
  179. data/config/action_view_helpers/actionview/form_tag_helper/week_field_tag.yml +28 -18
  180. data/config/action_view_helpers/actionview/javascript_helper/escape_javascript.yml +16 -10
  181. data/config/action_view_helpers/actionview/javascript_helper/javascript_cdata_section.yml +9 -6
  182. data/config/action_view_helpers/actionview/javascript_helper/javascript_tag.yml +41 -27
  183. data/config/action_view_helpers/actionview/number_helper/number_to_currency.yml +29 -18
  184. data/config/action_view_helpers/actionview/number_helper/number_to_human.yml +25 -15
  185. data/config/action_view_helpers/actionview/number_helper/number_to_human_size.yml +20 -12
  186. data/config/action_view_helpers/actionview/number_helper/number_to_percentage.yml +20 -12
  187. data/config/action_view_helpers/actionview/number_helper/number_to_phone.yml +33 -20
  188. data/config/action_view_helpers/actionview/number_helper/number_with_delimiter.yml +21 -13
  189. data/config/action_view_helpers/actionview/number_helper/number_with_precision.yml +25 -15
  190. data/config/action_view_helpers/actionview/output_safety_helper/raw.yml +15 -9
  191. data/config/action_view_helpers/actionview/output_safety_helper/safe_join.yml +20 -12
  192. data/config/action_view_helpers/actionview/output_safety_helper/to_sentence.yml +24 -15
  193. data/config/action_view_helpers/actionview/record_identifier/dom_class.yml +20 -12
  194. data/config/action_view_helpers/actionview/record_identifier/dom_id.yml +20 -12
  195. data/config/action_view_helpers/actionview/record_identifier/dom_target.yml +15 -9
  196. data/config/action_view_helpers/actionview/record_identifier/model_name_from_record_or_class.yml +9 -6
  197. data/config/action_view_helpers/actionview/rendering_helper/render.yml +108 -22
  198. data/config/action_view_helpers/actionview/sanitize_helper/sanitize.yml +25 -15
  199. data/config/action_view_helpers/actionview/sanitize_helper/sanitize_css.yml +15 -9
  200. data/config/action_view_helpers/actionview/sanitize_helper/sanitizer_vendor.yml +9 -6
  201. data/config/action_view_helpers/actionview/sanitize_helper/strip_links.yml +15 -9
  202. data/config/action_view_helpers/actionview/sanitize_helper/strip_tags.yml +15 -9
  203. data/config/action_view_helpers/actionview/tag_helper/cdata_section.yml +15 -9
  204. data/config/action_view_helpers/actionview/tag_helper/content_tag.yml +59 -38
  205. data/config/action_view_helpers/actionview/tag_helper/escape_once.yml +15 -9
  206. data/config/action_view_helpers/actionview/tag_helper/tag.yml +54 -31
  207. data/config/action_view_helpers/actionview/tag_helper/token_list.yml +16 -10
  208. data/config/action_view_helpers/actionview/text_helper/concat.yml +15 -9
  209. data/config/action_view_helpers/actionview/text_helper/current_cycle.yml +15 -9
  210. data/config/action_view_helpers/actionview/text_helper/cycle.yml +23 -14
  211. data/config/action_view_helpers/actionview/text_helper/excerpt.yml +33 -20
  212. data/config/action_view_helpers/actionview/text_helper/highlight.yml +37 -18
  213. data/config/action_view_helpers/actionview/text_helper/pluralize.yml +30 -18
  214. data/config/action_view_helpers/actionview/text_helper/reset_cycle.yml +15 -9
  215. data/config/action_view_helpers/actionview/text_helper/safe_concat.yml +9 -6
  216. data/config/action_view_helpers/actionview/text_helper/simple_format.yml +33 -20
  217. data/config/action_view_helpers/actionview/text_helper/truncate.yml +38 -23
  218. data/config/action_view_helpers/actionview/text_helper/word_wrap.yml +25 -15
  219. data/config/action_view_helpers/actionview/translation_helper/debug_missing_translation.yml +9 -6
  220. data/config/action_view_helpers/actionview/translation_helper/localize.yml +26 -16
  221. data/config/action_view_helpers/actionview/translation_helper/translate.yml +31 -19
  222. data/config/action_view_helpers/actionview/url_helper/button_to.yml +57 -33
  223. data/config/action_view_helpers/actionview/url_helper/button_to_generates_button_tag.yml +9 -6
  224. data/config/action_view_helpers/actionview/url_helper/current_page?.yml +25 -15
  225. data/config/action_view_helpers/actionview/url_helper/link_to.yml +76 -53
  226. data/config/action_view_helpers/actionview/url_helper/link_to_if.yml +54 -20
  227. data/config/action_view_helpers/actionview/url_helper/link_to_unless.yml +54 -20
  228. data/config/action_view_helpers/actionview/url_helper/link_to_unless_current.yml +49 -17
  229. data/config/action_view_helpers/actionview/url_helper/mail_to.yml +60 -34
  230. data/config/action_view_helpers/actionview/url_helper/phone_to.yml +40 -22
  231. data/config/action_view_helpers/actionview/url_helper/sms_to.yml +45 -25
  232. data/config/action_view_helpers/actionview/url_helper/url_for.yml +15 -9
  233. data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_import_module_tag.yml +32 -0
  234. data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_importmap_module_preload_tags.yml +39 -0
  235. data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_importmap_tags.yml +35 -0
  236. data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_inline_importmap_tag.yml +32 -0
  237. data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_module_preload_tag.yml +35 -0
  238. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache.yml +9 -6
  239. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache_tag.yml +12 -8
  240. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview.yml +9 -6
  241. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview_tag.yml +12 -8
  242. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload.yml +9 -6
  243. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload_tag.yml +12 -8
  244. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_method_tag.yml +17 -11
  245. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_scroll_tag.yml +17 -11
  246. data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refreshes_with.yml +20 -12
  247. data/config/action_view_helpers/turbo-rails/frames_helper/turbo_frame_tag.yml +54 -33
  248. data/config/action_view_helpers/turbo-rails/includes_helper/turbo_include_tags.yml +9 -6
  249. data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_action_tag.yml +32 -20
  250. data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_refresh_tag.yml +18 -11
  251. data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream.yml +9 -6
  252. data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream_from.yml +28 -18
  253. data/config/html_elements.yml +597 -0
  254. data/config/options.yml +1 -0
  255. data/config/slots/components.yml +52 -0
  256. data/config/state/kind.yml +61 -0
  257. data/config/state/operators.yml +27 -0
  258. data/config/state/predicates.yml +39 -0
  259. data/config/state/transforms.yml +18 -0
  260. data/config/view_context_methods/actionview/base/annotate_rendered_view_with_filenames.yml +4 -4
  261. data/config/view_context_methods/actionview/base/assign.yml +4 -4
  262. data/config/view_context_methods/actionview/base/assigns.yml +4 -4
  263. data/config/view_context_methods/actionview/base/automatically_disable_submit_tag.yml +4 -4
  264. data/config/view_context_methods/actionview/base/compiled_method_container.yml +4 -4
  265. data/config/view_context_methods/actionview/base/config.yml +4 -4
  266. data/config/view_context_methods/actionview/base/default_form_builder.yml +4 -4
  267. data/config/view_context_methods/actionview/base/default_formats.yml +4 -4
  268. data/config/view_context_methods/actionview/base/field_error_proc.yml +4 -4
  269. data/config/view_context_methods/actionview/base/formats.yml +4 -4
  270. data/config/view_context_methods/actionview/base/in_rendering_context.yml +4 -4
  271. data/config/view_context_methods/actionview/base/locale.yml +4 -4
  272. data/config/view_context_methods/actionview/base/lookup_context.yml +4 -4
  273. data/config/view_context_methods/actionview/base/output_buffer.yml +4 -4
  274. data/config/view_context_methods/actionview/base/prefix_partial_path_with_controller_namespace.yml +4 -4
  275. data/config/view_context_methods/actionview/base/remove_hidden_field_autocomplete.yml +4 -4
  276. data/config/view_context_methods/actionview/base/streaming_completion_on_exception.yml +4 -4
  277. data/config/view_context_methods/actionview/base/view_flow.yml +4 -4
  278. data/config/view_context_methods/actionview/base/view_paths.yml +4 -4
  279. data/config/view_context_methods/actionview/base/view_renderer.yml +4 -4
  280. data/config/view_context_methods/actionview/template/local_assigns.yml +4 -4
  281. data/config/view_context_methods/activemodel/conversion/convert_to_model.yml +4 -4
  282. data/config/view_context_methods/activesupport/benchmarkable/benchmark.yml +4 -4
  283. data/config.yml +1249 -786
  284. data/exe/herb +2 -0
  285. data/ext/herb/error_helpers.c +379 -17
  286. data/ext/herb/error_helpers.h +1 -1
  287. data/ext/herb/extconf.rb +4 -2
  288. data/ext/herb/extension.c +137 -74
  289. data/ext/herb/extension_helpers.c +81 -35
  290. data/ext/herb/extension_helpers.h +4 -1
  291. data/ext/herb/nodes.c +859 -374
  292. data/ext/herb/nodes.h +3 -2
  293. data/ext/herb/parser_options_helpers.c +151 -0
  294. data/ext/herb/parser_options_helpers.h +14 -0
  295. data/herb.gemspec +3 -2
  296. data/lib/herb/action_view/helper_registry.rb +1358 -62
  297. data/lib/herb/analysis/partial_declaration.rb +140 -0
  298. data/lib/herb/analysis/partial_index.rb +189 -0
  299. data/lib/herb/analysis/partial_resolution.rb +161 -0
  300. data/lib/herb/analysis/partial_resolver.rb +144 -0
  301. data/lib/herb/analysis/project_index.rb +152 -0
  302. data/lib/herb/{action_view → analysis}/render_analyzer.rb +287 -77
  303. data/lib/herb/analysis/render_graph/ancestor_chain.rb +27 -0
  304. data/lib/herb/analysis/render_graph/builder.rb +376 -0
  305. data/lib/herb/analysis/render_graph/call_frame.rb +9 -0
  306. data/lib/herb/analysis/render_graph/call_site_location.rb +23 -0
  307. data/lib/herb/analysis/render_graph/inferred_signature.rb +21 -0
  308. data/lib/herb/analysis/render_graph/partial_call_site.rb +40 -0
  309. data/lib/herb/analysis/render_graph/partial_context.rb +46 -0
  310. data/lib/herb/analysis/render_graph/template_roots.rb +31 -0
  311. data/lib/herb/analysis/render_graph.rb +285 -0
  312. data/lib/herb/analysis/ruby_locals_index/local.rb +25 -0
  313. data/lib/herb/analysis/ruby_locals_index/named_reference.rb +22 -0
  314. data/lib/herb/analysis/ruby_locals_index/offset_table.rb +44 -0
  315. data/lib/herb/analysis/ruby_locals_index/reference_collector.rb +80 -0
  316. data/lib/herb/analysis/ruby_locals_index/state_locals.rb +49 -0
  317. data/lib/herb/analysis/ruby_locals_index.rb +165 -0
  318. data/lib/herb/analysis/ruby_reference.rb +67 -0
  319. data/lib/herb/analysis/template_dependencies/dependency_collector.rb +179 -0
  320. data/lib/herb/analysis/template_dependencies/node_dependency_collector.rb +309 -0
  321. data/lib/herb/analysis/template_dependencies.rb +562 -0
  322. data/lib/herb/ast/erb_render_node.rb +26 -94
  323. data/lib/herb/ast/helpers.rb +90 -10
  324. data/lib/herb/ast/herb_directive_node.rb +18 -0
  325. data/lib/herb/ast/node.rb +32 -2
  326. data/lib/herb/ast/nodes.rb +1368 -105
  327. data/lib/herb/backend.rb +73 -0
  328. data/lib/herb/bootstrap.rb +8 -8
  329. data/lib/herb/cli.rb +555 -32
  330. data/lib/herb/colors.rb +14 -0
  331. data/lib/herb/configuration.rb +71 -35
  332. data/lib/herb/defaults.yml +2 -1
  333. data/lib/herb/dev/assets.rb +57 -0
  334. data/lib/herb/dev/classifier.rb +84 -0
  335. data/lib/herb/dev/embedded.rb +27 -0
  336. data/lib/herb/dev/pipeline.rb +305 -0
  337. data/lib/herb/dev/protocol.rb +221 -0
  338. data/lib/herb/dev/runner.rb +180 -175
  339. data/lib/herb/dev/server.rb +89 -26
  340. data/lib/herb/dev/server_entry.rb +41 -6
  341. data/lib/herb/dev/watcher.rb +181 -0
  342. data/lib/herb/dev.rb +163 -0
  343. data/lib/herb/diagnostic/formatter.rb +88 -0
  344. data/lib/herb/diagnostic.rb +172 -0
  345. data/lib/herb/diff/operation.rb +36 -0
  346. data/lib/herb/diff/result.rb +62 -0
  347. data/lib/herb/diff.rb +10 -0
  348. data/lib/herb/engine/collector.rb +62 -0
  349. data/lib/herb/engine/compiler.rb +387 -113
  350. data/lib/herb/engine/component_tags/constant_resolver.rb +28 -0
  351. data/lib/herb/engine/component_tags/partial_resolver.rb +54 -0
  352. data/lib/herb/engine/component_tags/resolver.rb +32 -0
  353. data/lib/herb/engine/component_tags/visitor.rb +231 -0
  354. data/lib/herb/engine/css_inliner/inliner.rb +101 -0
  355. data/lib/herb/engine/css_inliner/visitor.rb +174 -0
  356. data/lib/herb/engine/errors.rb +122 -0
  357. data/lib/herb/engine/helpers.rb +82 -0
  358. data/lib/herb/engine/inline_render/inliner.rb +122 -0
  359. data/lib/herb/engine/inline_render/visitor.rb +267 -0
  360. data/lib/herb/engine/runtime/entry.rb +62 -0
  361. data/lib/herb/engine/runtime/error_page.rb +362 -0
  362. data/lib/herb/engine/runtime/html_safe_assertions.rb +217 -0
  363. data/lib/herb/engine/runtime/journal/summary.rb +227 -0
  364. data/lib/herb/engine/runtime/journal.rb +379 -0
  365. data/lib/herb/engine/runtime/middleware.rb +212 -0
  366. data/lib/herb/engine/runtime/observations.rb +73 -0
  367. data/lib/herb/engine/runtime/report.rb +204 -0
  368. data/lib/herb/engine/runtime/session.rb +437 -0
  369. data/lib/herb/engine/runtime.rb +21 -0
  370. data/lib/herb/engine/scoped_style/channel.rb +66 -0
  371. data/lib/herb/engine/scoped_style/collector.rb +74 -0
  372. data/lib/herb/engine/scoped_style/visitor.rb +533 -0
  373. data/lib/herb/engine/slots/annotation.rb +98 -0
  374. data/lib/herb/engine/slots/bindings.rb +61 -0
  375. data/lib/herb/engine/slots/callee.rb +118 -0
  376. data/lib/herb/engine/slots/component_definitions.rb +67 -0
  377. data/lib/herb/engine/slots/components/async.rb +24 -0
  378. data/lib/herb/engine/slots/components/base.rb +132 -0
  379. data/lib/herb/engine/slots/components/deferred.rb +81 -0
  380. data/lib/herb/engine/slots/components/fallback.rb +27 -0
  381. data/lib/herb/engine/slots/components/fragment.rb +99 -0
  382. data/lib/herb/engine/slots/components/lazy.rb +24 -0
  383. data/lib/herb/engine/slots/components.rb +52 -0
  384. data/lib/herb/engine/slots/dependencies/channel.rb +72 -0
  385. data/lib/herb/engine/slots/dependencies.rb +269 -0
  386. data/lib/herb/engine/slots/dynamics_compiler.rb +864 -0
  387. data/lib/herb/engine/slots/identifier.rb +35 -0
  388. data/lib/herb/engine/slots/manifest/channel.rb +74 -0
  389. data/lib/herb/engine/slots/manifest/collector.rb +75 -0
  390. data/lib/herb/engine/slots/markers.rb +152 -0
  391. data/lib/herb/engine/slots/render_bindings.rb +141 -0
  392. data/lib/herb/engine/slots/schema_compiler.rb +94 -0
  393. data/lib/herb/engine/slots/state_anchor.rb +94 -0
  394. data/lib/herb/engine/slots/state_compiler.rb +1325 -0
  395. data/lib/herb/engine/slots/state_directives.rb +854 -0
  396. data/lib/herb/engine/slots/state_kinds.rb +54 -0
  397. data/lib/herb/engine/slots/state_operators.rb +36 -0
  398. data/lib/herb/engine/slots/state_overrides.rb +79 -0
  399. data/lib/herb/engine/slots/state_predicates.rb +65 -0
  400. data/lib/herb/engine/slots/state_transforms.rb +42 -0
  401. data/lib/herb/engine/slots/statics.rb +185 -0
  402. data/lib/herb/engine/slots/subtree.rb +82 -0
  403. data/lib/herb/engine/slots/subtree_compiler.rb +255 -0
  404. data/lib/herb/engine/slots/types.rb +42 -0
  405. data/lib/herb/engine/slots/visitor.rb +2267 -0
  406. data/lib/herb/engine/validators/accessibility_validator.rb +3 -3
  407. data/lib/herb/engine/validators/base.rb +36 -0
  408. data/lib/herb/engine/validators/generator_template_validator.rb +39 -0
  409. data/lib/herb/engine/validators/nesting_validator.rb +3 -3
  410. data/lib/herb/engine/validators/render_validator.rb +13 -33
  411. data/lib/herb/engine/validators/security_validator.rb +3 -17
  412. data/lib/herb/engine/validators.rb +43 -0
  413. data/lib/herb/engine/visitors/auto_close_omitted_tags_visitor.rb +48 -0
  414. data/lib/herb/engine/visitors/content_for_visitor.rb +127 -0
  415. data/lib/herb/engine/{debug_visitor.rb → visitors/debug_visitor.rb} +122 -94
  416. data/lib/herb/engine/visitors/html_safe_assertions_visitor.rb +281 -0
  417. data/lib/herb/engine/visitors/instrumentation_visitor.rb +290 -0
  418. data/lib/herb/engine/visitors/optimize_visitor.rb +728 -0
  419. data/lib/herb/engine/visitors/remove_comments_visitor.rb +106 -0
  420. data/lib/herb/engine/visitors/source_attribution_visitor.rb +177 -0
  421. data/lib/herb/engine.rb +218 -259
  422. data/lib/herb/ensure_installed.rb +43 -0
  423. data/lib/herb/errors.rb +681 -153
  424. data/lib/herb/fingerprint.rb +82 -0
  425. data/lib/herb/html/elements.rb +18 -0
  426. data/lib/herb/html/util.rb +21 -2
  427. data/lib/herb/lex_result.rb +0 -10
  428. data/lib/herb/locate.rb +163 -0
  429. data/lib/herb/location.rb +20 -0
  430. data/lib/herb/parse_result.rb +17 -11
  431. data/lib/herb/parser_options.rb +69 -40
  432. data/lib/herb/position.rb +19 -0
  433. data/lib/herb/prism_inspect.rb +1 -4
  434. data/lib/herb/project.rb +39 -23
  435. data/lib/herb/range.rb +5 -0
  436. data/lib/herb/result.rb +2 -2
  437. data/lib/herb/ruby_program.rb +110 -0
  438. data/lib/herb/source_path.rb +232 -0
  439. data/lib/herb/token.rb +14 -3
  440. data/lib/herb/version.rb +1 -1
  441. data/lib/herb/visitor/context/origin.rb +52 -0
  442. data/lib/herb/visitor/context/replacements.rb +59 -0
  443. data/lib/herb/visitor/context.rb +169 -0
  444. data/lib/herb/visitor/context_aware.rb +45 -0
  445. data/lib/herb/visitor/diagnostics.rb +148 -0
  446. data/lib/herb/visitor/experimental.rb +33 -0
  447. data/lib/herb/visitor/parser_option_requirements.rb +151 -0
  448. data/lib/herb/visitor/stack.rb +192 -0
  449. data/lib/herb/visitor.rb +47 -1
  450. data/lib/herb/warnings.rb +25 -0
  451. data/lib/herb.rb +74 -63
  452. data/sig/herb/action_view/helper_registry.rbs +82 -10
  453. data/sig/herb/analysis/partial_declaration.rbs +80 -0
  454. data/sig/herb/analysis/partial_index.rbs +66 -0
  455. data/sig/herb/analysis/partial_resolution.rbs +57 -0
  456. data/sig/herb/analysis/partial_resolver.rbs +76 -0
  457. data/sig/herb/analysis/project_index.rbs +57 -0
  458. data/sig/herb/{action_view → analysis}/render_analyzer.rbs +25 -4
  459. data/sig/herb/analysis/render_graph/ancestor_chain.rbs +22 -0
  460. data/sig/herb/analysis/render_graph/builder.rbs +180 -0
  461. data/sig/herb/analysis/render_graph/call_frame.rbs +26 -0
  462. data/sig/herb/analysis/render_graph/call_site_location.rbs +28 -0
  463. data/sig/herb/analysis/render_graph/inferred_signature.rbs +27 -0
  464. data/sig/herb/analysis/render_graph/partial_call_site.rbs +36 -0
  465. data/sig/herb/analysis/render_graph/partial_context.rbs +31 -0
  466. data/sig/herb/analysis/render_graph/template_roots.rbs +32 -0
  467. data/sig/herb/analysis/render_graph.rbs +83 -0
  468. data/sig/herb/analysis/ruby_locals_index/local.rbs +21 -0
  469. data/sig/herb/analysis/ruby_locals_index/named_reference.rbs +20 -0
  470. data/sig/herb/analysis/ruby_locals_index/offset_table.rbs +26 -0
  471. data/sig/herb/analysis/ruby_locals_index/reference_collector.rbs +40 -0
  472. data/sig/herb/analysis/ruby_locals_index/state_locals.rbs +19 -0
  473. data/sig/herb/analysis/ruby_locals_index.rbs +62 -0
  474. data/sig/herb/analysis/ruby_reference.rbs +28 -0
  475. data/sig/herb/analysis/template_dependencies/dependency_collector.rbs +52 -0
  476. data/sig/herb/analysis/template_dependencies/node_dependency_collector.rbs +81 -0
  477. data/sig/herb/analysis/template_dependencies.rbs +125 -0
  478. data/sig/herb/ast/erb_render_node.rbs +10 -2
  479. data/sig/herb/ast/helpers.rbs +31 -1
  480. data/sig/herb/ast/herb_directive_node.rbs +13 -0
  481. data/sig/herb/ast/node.rbs +9 -0
  482. data/sig/herb/ast/nodes.rbs +668 -89
  483. data/sig/herb/backend.rbs +52 -0
  484. data/sig/herb/bootstrap.rbs +2 -0
  485. data/sig/herb/colors.rbs +3 -0
  486. data/sig/herb/configuration.rbs +27 -3
  487. data/sig/herb/dev/assets.rbs +27 -0
  488. data/sig/herb/dev/classifier.rbs +57 -0
  489. data/sig/herb/dev/embedded.rbs +21 -0
  490. data/sig/herb/dev/pipeline.rbs +118 -0
  491. data/sig/herb/dev/protocol.rbs +78 -0
  492. data/sig/herb/dev/runner.rbs +64 -23
  493. data/sig/herb/dev/server.rbs +49 -22
  494. data/sig/herb/dev/server_entry.rbs +46 -21
  495. data/sig/herb/dev/watcher.rbs +84 -0
  496. data/sig/herb/dev.rbs +58 -0
  497. data/sig/herb/diagnostic/formatter.rbs +28 -0
  498. data/sig/herb/diagnostic.rbs +88 -0
  499. data/sig/herb/diff/operation.rbs +36 -0
  500. data/sig/herb/diff/result.rbs +36 -0
  501. data/sig/herb/diff.rbs +6 -0
  502. data/sig/herb/engine/collector.rbs +48 -0
  503. data/sig/herb/engine/compiler.rbs +74 -24
  504. data/sig/herb/engine/component_tags/constant_resolver.rbs +19 -0
  505. data/sig/herb/engine/component_tags/partial_resolver.rbs +30 -0
  506. data/sig/herb/engine/component_tags/resolver.rbs +25 -0
  507. data/sig/herb/engine/component_tags/visitor.rbs +69 -0
  508. data/sig/herb/engine/css_inliner/inliner.rbs +65 -0
  509. data/sig/herb/engine/css_inliner/visitor.rbs +87 -0
  510. data/sig/herb/engine/errors.rbs +68 -0
  511. data/sig/herb/engine/helpers.rbs +28 -0
  512. data/sig/herb/engine/inline_render/inliner.rbs +39 -0
  513. data/sig/herb/engine/inline_render/visitor.rbs +104 -0
  514. data/sig/herb/engine/runtime/entry.rbs +43 -0
  515. data/sig/herb/engine/runtime/error_page.rbs +115 -0
  516. data/sig/herb/engine/runtime/html_safe_assertions.rbs +99 -0
  517. data/sig/herb/engine/runtime/journal/summary.rbs +172 -0
  518. data/sig/herb/engine/runtime/journal.rbs +126 -0
  519. data/sig/herb/engine/runtime/middleware.rbs +96 -0
  520. data/sig/herb/engine/runtime/observations.rbs +38 -0
  521. data/sig/herb/engine/runtime/report.rbs +97 -0
  522. data/sig/herb/engine/runtime/session.rbs +233 -0
  523. data/sig/herb/engine/runtime.rbs +14 -0
  524. data/sig/herb/engine/scoped_style/channel.rbs +45 -0
  525. data/sig/herb/engine/scoped_style/collector.rbs +45 -0
  526. data/sig/herb/engine/scoped_style/visitor.rbs +220 -0
  527. data/sig/herb/engine/slots/annotation.rbs +72 -0
  528. data/sig/herb/engine/slots/bindings.rbs +34 -0
  529. data/sig/herb/engine/slots/callee.rbs +62 -0
  530. data/sig/herb/engine/slots/component_definitions.rbs +19 -0
  531. data/sig/herb/engine/slots/components/async.rbs +20 -0
  532. data/sig/herb/engine/slots/components/base.rbs +60 -0
  533. data/sig/herb/engine/slots/components/deferred.rbs +29 -0
  534. data/sig/herb/engine/slots/components/fallback.rbs +21 -0
  535. data/sig/herb/engine/slots/components/fragment.rbs +34 -0
  536. data/sig/herb/engine/slots/components/lazy.rbs +20 -0
  537. data/sig/herb/engine/slots/components.rbs +30 -0
  538. data/sig/herb/engine/slots/dependencies/channel.rbs +51 -0
  539. data/sig/herb/engine/slots/dependencies.rbs +94 -0
  540. data/sig/herb/engine/slots/dynamics_compiler.rbs +352 -0
  541. data/sig/herb/engine/slots/identifier.rbs +19 -0
  542. data/sig/herb/engine/slots/manifest/channel.rbs +49 -0
  543. data/sig/herb/engine/slots/manifest/collector.rbs +45 -0
  544. data/sig/herb/engine/slots/markers.rbs +99 -0
  545. data/sig/herb/engine/slots/render_bindings.rbs +69 -0
  546. data/sig/herb/engine/slots/schema_compiler.rbs +62 -0
  547. data/sig/herb/engine/slots/state_anchor.rbs +41 -0
  548. data/sig/herb/engine/slots/state_compiler.rbs +258 -0
  549. data/sig/herb/engine/slots/state_directives.rbs +278 -0
  550. data/sig/herb/engine/slots/state_kinds.rbs +24 -0
  551. data/sig/herb/engine/slots/state_operators.rbs +19 -0
  552. data/sig/herb/engine/slots/state_overrides.rbs +33 -0
  553. data/sig/herb/engine/slots/state_predicates.rbs +16 -0
  554. data/sig/herb/engine/slots/state_transforms.rbs +15 -0
  555. data/sig/herb/engine/slots/statics.rbs +67 -0
  556. data/sig/herb/engine/slots/subtree.rbs +49 -0
  557. data/sig/herb/engine/slots/subtree_compiler.rbs +130 -0
  558. data/sig/herb/engine/slots/types.rbs +46 -0
  559. data/sig/herb/engine/slots/visitor.rbs +603 -0
  560. data/sig/herb/engine/validators/accessibility_validator.rbs +1 -1
  561. data/sig/herb/engine/validators/base.rbs +28 -0
  562. data/sig/herb/engine/validators/generator_template_validator.rbs +19 -0
  563. data/sig/herb/engine/validators/nesting_validator.rbs +1 -1
  564. data/sig/herb/engine/validators/render_validator.rbs +2 -6
  565. data/sig/herb/engine/validators/security_validator.rbs +1 -3
  566. data/sig/herb/engine/validators.rbs +21 -0
  567. data/sig/herb/engine/visitors/auto_close_omitted_tags_visitor.rbs +26 -0
  568. data/sig/herb/engine/visitors/content_for_visitor.rbs +52 -0
  569. data/sig/herb/engine/{debug_visitor.rbs → visitors/debug_visitor.rbs} +26 -15
  570. data/sig/herb/engine/visitors/html_safe_assertions_visitor.rbs +100 -0
  571. data/sig/herb/engine/visitors/instrumentation_visitor.rbs +111 -0
  572. data/sig/herb/engine/visitors/optimize_visitor.rbs +246 -0
  573. data/sig/herb/engine/visitors/remove_comments_visitor.rbs +66 -0
  574. data/sig/herb/engine/visitors/source_attribution_visitor.rbs +90 -0
  575. data/sig/herb/engine.rbs +47 -41
  576. data/sig/herb/ensure_installed.rbs +9 -0
  577. data/sig/herb/errors.rbs +311 -0
  578. data/sig/herb/fingerprint.rbs +37 -0
  579. data/sig/herb/html/elements.rbs +19 -0
  580. data/sig/herb/html/util.rbs +15 -1
  581. data/sig/herb/lex_result.rbs +0 -6
  582. data/sig/herb/locate.rbs +89 -0
  583. data/sig/herb/location.rbs +12 -0
  584. data/sig/herb/parse_result.rbs +10 -8
  585. data/sig/herb/parser_options.rbs +53 -19
  586. data/sig/herb/position.rbs +11 -0
  587. data/sig/herb/range.rbs +3 -0
  588. data/sig/herb/ruby_program.rbs +51 -0
  589. data/sig/herb/source_path.rbs +132 -0
  590. data/sig/herb/token.rbs +5 -2
  591. data/sig/herb/visitor/context/origin.rbs +51 -0
  592. data/sig/herb/visitor/context/replacements.rbs +39 -0
  593. data/sig/herb/visitor/context.rbs +83 -0
  594. data/sig/herb/visitor/context_aware.rbs +32 -0
  595. data/sig/herb/visitor/diagnostics.rbs +82 -0
  596. data/sig/herb/visitor/experimental.rbs +23 -0
  597. data/sig/herb/visitor/parser_option_requirements.rbs +76 -0
  598. data/sig/herb/visitor/stack.rbs +91 -0
  599. data/sig/herb/visitor.rbs +22 -0
  600. data/sig/herb/warnings.rbs +10 -0
  601. data/sig/herb.rbs +27 -10
  602. data/sig/manifest.yaml +13 -0
  603. data/sig/serialized_ast_errors.rbs +62 -1
  604. data/sig/serialized_ast_nodes.rbs +59 -2
  605. data/src/analyze/action_view/attribute_extraction_helpers.c +73 -36
  606. data/src/analyze/action_view/generated_handlers.c +37 -1
  607. data/src/analyze/action_view/generated_handlers.h +2 -1
  608. data/src/analyze/action_view/helper_registry.c +1353 -58
  609. data/src/analyze/action_view/registry.c +10 -17
  610. data/src/analyze/action_view/stylesheet_link_tag.c +40 -0
  611. data/src/analyze/action_view/tag_helper_node_builders.c +63 -3
  612. data/src/analyze/action_view/tag_helpers.c +502 -111
  613. data/src/analyze/analyze.c +306 -89
  614. data/src/analyze/analyze_helpers.c +502 -237
  615. data/src/analyze/analyzed_ruby.c +2 -0
  616. data/src/analyze/builders.c +80 -51
  617. data/src/analyze/conditional_elements.c +13 -8
  618. data/src/analyze/conditional_open_tags.c +11 -5
  619. data/src/analyze/control_type.c +36 -13
  620. data/src/analyze/herb_directives.c +701 -0
  621. data/src/analyze/invalid_structures.c +11 -7
  622. data/src/analyze/iteration_nodes.c +306 -0
  623. data/src/analyze/missing_end.c +116 -32
  624. data/src/analyze/parse_errors.c +8 -3
  625. data/src/analyze/postfix_conditionals.c +98 -63
  626. data/src/analyze/prism_annotate.c +45 -13
  627. data/src/analyze/render_nodes.c +348 -123
  628. data/src/analyze/strict_locals.c +30 -26
  629. data/src/analyze/ternary_conditionals.c +95 -70
  630. data/src/analyze/transform.c +43 -1
  631. data/src/ast/ast_node.c +3 -13
  632. data/src/ast/ast_nodes.c +914 -113
  633. data/src/ast/ast_pretty_print.c +166 -3
  634. data/src/diff/herb_diff.c +8 -0
  635. data/src/diff/herb_diff_attributes.c +1 -0
  636. data/src/diff/herb_diff_children.c +4 -3
  637. data/src/diff/herb_diff_helpers.c +7 -1
  638. data/src/diff/herb_diff_nodes.c +186 -71
  639. data/src/diff/herb_hash_tree.c +99 -1
  640. data/src/errors.c +1124 -105
  641. data/src/extract.c +227 -144
  642. data/src/herb.c +43 -8
  643. data/src/include/analyze/action_view/attribute_extraction_helpers.h +1 -1
  644. data/src/include/analyze/action_view/helper_registry.h +28 -4
  645. data/src/include/analyze/action_view/tag_helper_handler.h +1 -1
  646. data/src/include/analyze/action_view/tag_helper_node_builders.h +7 -0
  647. data/src/include/analyze/analyze.h +11 -22
  648. data/src/include/analyze/analyzed_ruby.h +25 -0
  649. data/src/include/analyze/builders.h +16 -0
  650. data/src/include/analyze/helpers.h +25 -24
  651. data/src/include/analyze/herb_directive_kinds.h +41 -0
  652. data/src/include/analyze/herb_directives.h +14 -0
  653. data/src/include/analyze/iteration_nodes.h +11 -0
  654. data/src/include/analyze/prism_annotate.h +3 -3
  655. data/src/include/analyze/ternary_conditionals.h +2 -0
  656. data/src/include/ast/ast_node.h +1 -5
  657. data/src/include/ast/ast_nodes.h +78 -3
  658. data/src/include/ast/ast_pretty_print.h +1 -1
  659. data/src/include/diff/herb_diff.h +11 -0
  660. data/src/include/errors.h +163 -38
  661. data/src/include/extract.h +11 -0
  662. data/src/include/herb.h +6 -0
  663. data/src/include/lexer/erb_openers.h +29 -0
  664. data/src/include/lexer/lexer.h +1 -0
  665. data/src/include/lexer/lexer_peek_helpers.h +8 -1
  666. data/src/include/lexer/lexer_struct.h +4 -0
  667. data/src/include/lexer/token.h +5 -0
  668. data/src/include/lexer/token_struct.h +8 -6
  669. data/src/include/lib/hb_allocator.h +2 -1
  670. data/src/include/lib/hb_array.h +2 -0
  671. data/src/include/lib/hb_clock.h +15 -0
  672. data/src/include/lib/hb_foreach.h +1 -1
  673. data/src/include/lib/hb_string.h +7 -0
  674. data/src/include/parser/dot_notation.h +1 -1
  675. data/src/include/parser/foreign_content_elements.h +32 -0
  676. data/src/include/parser/parser.h +40 -26
  677. data/src/include/parser/parser_helpers.h +13 -11
  678. data/src/include/parser/parser_options.h +41 -0
  679. data/src/include/prism/herb_prism_node.h +6 -1
  680. data/src/include/prism/ruby_parser.h +6 -0
  681. data/src/include/util/html_elements.h +85 -0
  682. data/src/include/util/html_util.h +1 -0
  683. data/src/include/version.h +1 -1
  684. data/src/lexer/lexer_peek_helpers.c +15 -1
  685. data/src/lexer/token.c +89 -1
  686. data/src/lexer.c +228 -12
  687. data/src/lib/hb_allocator.c +2 -0
  688. data/src/lib/hb_array.c +26 -0
  689. data/src/lib/hb_string.c +26 -0
  690. data/src/main.c +1 -1
  691. data/src/parser/dot_notation.c +4 -3
  692. data/src/parser/match_tags.c +66 -1
  693. data/src/parser/parser_helpers.c +69 -37
  694. data/src/parser.c +658 -385
  695. data/src/parser_options_defaults.c +30 -0
  696. data/src/prism/prism_helpers.c +94 -0
  697. data/src/prism/ruby_parser.c +49 -0
  698. data/src/util/html_util.c +11 -58
  699. data/src/visitor.c +77 -1
  700. data/templates/ext/herb/error_helpers.c.erb +1 -1
  701. data/templates/ext/herb/nodes.c.erb +19 -14
  702. data/templates/ext/herb/nodes.h.erb +2 -1
  703. data/templates/ext/herb/parser_options_helpers.c.erb +69 -0
  704. data/templates/ext/herb/parser_options_helpers.h.erb +11 -0
  705. data/templates/java/nodes.c.erb +21 -17
  706. data/templates/java/nodes.h.erb +3 -2
  707. data/templates/java/org/herb/ParserOptions.java.erb +24 -0
  708. data/templates/java/org/herb/ast/HelperRegistry.java.erb +67 -31
  709. data/templates/java/org/herb/ast/HelperType.java.erb +29 -0
  710. data/templates/java/org/herb/ast/Nodes.java.erb +11 -7
  711. data/templates/java/parser_options_helpers.c.erb +45 -0
  712. data/templates/java/parser_options_helpers.h.erb +10 -0
  713. data/templates/javascript/packages/client/src/state-kinds.ts.erb +49 -0
  714. data/templates/javascript/packages/client/src/state-operators.ts.erb +15 -0
  715. data/templates/javascript/packages/client/src/state-predicates.ts.erb +27 -0
  716. data/templates/javascript/packages/client/src/state-transforms.ts.erb +19 -0
  717. data/templates/javascript/packages/core/src/action-view-helpers.ts.erb +47 -0
  718. data/templates/javascript/packages/core/src/built-in-components.ts.erb +67 -0
  719. data/templates/javascript/packages/core/src/errors.ts.erb +9 -3
  720. data/templates/javascript/packages/core/src/foreign-content-elements.ts.erb +18 -0
  721. data/templates/javascript/packages/core/src/html-constants.ts.erb +32 -0
  722. data/templates/javascript/packages/core/src/html-elements.ts.erb +41 -0
  723. data/templates/javascript/packages/core/src/node-type-guards.ts.erb +11 -7
  724. data/templates/javascript/packages/core/src/nodes.ts.erb +103 -20
  725. data/templates/javascript/packages/core/src/parser-options.ts.erb +41 -0
  726. data/templates/javascript/packages/core/src/visitor.ts.erb +1 -1
  727. data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +3 -3
  728. data/templates/javascript/packages/node/extension/nodes.cpp.erb +18 -13
  729. data/templates/javascript/packages/node/extension/nodes.h.erb +3 -3
  730. data/templates/javascript/packages/node/extension/parser_options_helpers.cpp.erb +41 -0
  731. data/templates/javascript/packages/node/extension/parser_options_helpers.h.erb +12 -0
  732. data/templates/lib/herb/action_view/helper_registry.rb.erb +77 -3
  733. data/templates/lib/herb/ast/nodes.rb.erb +16 -6
  734. data/templates/lib/herb/engine/slots/component_definitions.rb.erb +38 -0
  735. data/templates/lib/herb/engine/slots/state_kinds.rb.erb +37 -0
  736. data/templates/lib/herb/engine/slots/state_operators.rb.erb +26 -0
  737. data/templates/lib/herb/engine/slots/state_predicates.rb.erb +39 -0
  738. data/templates/lib/herb/engine/slots/state_transforms.rb.erb +27 -0
  739. data/templates/lib/herb/errors.rb.erb +34 -6
  740. data/templates/lib/herb/html/elements.rb.erb +12 -0
  741. data/templates/lib/herb/parser_options.rb.erb +32 -0
  742. data/templates/lib/herb/visitor.rb.erb +7 -1
  743. data/templates/rust/herb-printer/src/printer_visitor.rs.erb +14 -0
  744. data/templates/rust/src/action_view_helpers.rs.erb +38 -0
  745. data/templates/rust/src/ast/nodes.rs.erb +21 -31
  746. data/templates/rust/src/errors.rs.erb +1 -1
  747. data/templates/rust/src/nodes.rs.erb +58 -26
  748. data/templates/rust/src/parser_options.rs.erb +16 -0
  749. data/templates/rust/src/prism/generated_deserialize.rs.erb +109 -0
  750. data/templates/rust/src/prism/generated_prettyprint.rs.erb +153 -0
  751. data/templates/rust/src/union_types.rs.erb +7 -1
  752. data/templates/rust/src/visitor.rs.erb +1 -1
  753. data/templates/src/analyze/action_view/helper_registry.c.erb +22 -0
  754. data/templates/src/analyze/missing_end.c.erb +13 -5
  755. data/templates/src/ast/ast_nodes.c.erb +41 -2
  756. data/templates/src/diff/herb_diff_nodes.c.erb +44 -8
  757. data/templates/src/errors.c.erb +8 -3
  758. data/templates/src/include/analyze/action_view/helper_registry.h.erb +19 -0
  759. data/templates/src/include/analyze/herb_directive_kinds.h.erb +25 -0
  760. data/templates/src/include/errors.h.erb +3 -1
  761. data/templates/src/include/parser/foreign_content_elements.h.erb +23 -0
  762. data/templates/src/include/parser/parser_options.h.erb +21 -0
  763. data/templates/src/include/util/html_elements.h.erb +28 -0
  764. data/templates/src/parser_options_defaults.c.erb +9 -0
  765. data/templates/template.rb +564 -9
  766. data/templates/wasm/error_helpers.cpp.erb +4 -4
  767. data/templates/wasm/nodes.cpp.erb +17 -27
  768. data/templates/wasm/nodes.h.erb +3 -3
  769. data/templates/wasm/parser_options_helpers.cpp.erb +25 -0
  770. data/templates/wasm/parser_options_helpers.h.erb +12 -0
  771. metadata +309 -30
  772. data/config/action_view_helpers/actionview/form_helper/button.yml +0 -38
  773. data/config/action_view_helpers/actionview/form_helper/submit.yml +0 -35
  774. data/lib/herb/ast.rb +0 -7
  775. data/lib/herb/diff_operation.rb +0 -34
  776. data/lib/herb/diff_result.rb +0 -59
  777. data/lib/herb/engine/error_formatter.rb +0 -432
  778. data/lib/herb/engine/parser_error_overlay.rb +0 -771
  779. data/lib/herb/engine/validation_error_overlay.rb +0 -182
  780. data/lib/herb/engine/validation_errors.rb +0 -65
  781. data/lib/herb/engine/validator.rb +0 -80
  782. data/sig/herb/ast.rbs +0 -6
  783. data/sig/herb/diff_operation.rbs +0 -34
  784. data/sig/herb/diff_result.rbs +0 -34
  785. data/sig/herb/engine/debug.rbs +0 -38
  786. data/sig/herb/engine/error_formatter.rbs +0 -47
  787. data/sig/herb/engine/parser_error_overlay.rbs +0 -41
  788. data/sig/herb/engine/validation_error_overlay.rbs +0 -35
  789. data/sig/herb/engine/validation_errors.rbs +0 -45
  790. data/sig/herb/engine/validator.rbs +0 -41
  791. data/sig/herb_c_extension.rbs +0 -10
  792. data/sig/vendor/did_you_mean.rbs +0 -6
  793. data/sig/vendor/parallel.rbs +0 -4
data/src/errors.c CHANGED
@@ -1,7 +1,8 @@
1
1
  // NOTE: This file is generated by the templates/template.rb script and should not
2
- // be modified manually. See /home/runner/work/herb/herb/templates/src/errors.c.erb
2
+ // be modified manually. See templates/src/errors.c.erb
3
3
 
4
4
  #include "include/errors.h"
5
+ #include "include/parser/parser.h"
5
6
  #include "include/location/location.h"
6
7
  #include "include/location/position.h"
7
8
  #include "include/ast/pretty_print.h"
@@ -69,8 +70,12 @@ UNEXPECTED_ERROR_T* unexpected_error_init(hb_string_T description, hb_string_T e
69
70
  return unexpected_error;
70
71
  }
71
72
 
72
- void append_unexpected_error(hb_string_T description, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
73
- hb_array_append(errors, unexpected_error_init(description, expected, found, start, end, allocator));
73
+ void append_unexpected_error(hb_string_T description, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
74
+ if (parser_options_errors_exceeded(options)) { return; }
75
+
76
+ hb_array_append_lazy(errors, unexpected_error_init(description, expected, found, start, end, allocator), allocator);
77
+
78
+ parser_options_increment_error_count(options);
74
79
  }
75
80
 
76
81
  UNEXPECTED_TOKEN_ERROR_T* unexpected_token_error_init(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -108,8 +113,12 @@ UNEXPECTED_TOKEN_ERROR_T* unexpected_token_error_init(token_type_T expected_type
108
113
  return unexpected_token_error;
109
114
  }
110
115
 
111
- void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
112
- hb_array_append(errors, unexpected_token_error_init(expected_type, found, start, end, allocator));
116
+ void append_unexpected_token_error(token_type_T expected_type, token_T* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
117
+ if (parser_options_errors_exceeded(options)) { return; }
118
+
119
+ hb_array_append_lazy(errors, unexpected_token_error_init(expected_type, found, start, end, allocator), allocator);
120
+
121
+ parser_options_increment_error_count(options);
113
122
  }
114
123
 
115
124
  MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -141,8 +150,12 @@ MISSING_OPENING_TAG_ERROR_T* missing_opening_tag_error_init(token_T* closing_tag
141
150
  return missing_opening_tag_error;
142
151
  }
143
152
 
144
- void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
145
- hb_array_append(errors, missing_opening_tag_error_init(closing_tag, start, end, allocator));
153
+ void append_missing_opening_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
154
+ if (parser_options_errors_exceeded(options)) { return; }
155
+
156
+ hb_array_append_lazy(errors, missing_opening_tag_error_init(closing_tag, start, end, allocator), allocator);
157
+
158
+ parser_options_increment_error_count(options);
146
159
  }
147
160
 
148
161
  MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -179,8 +192,12 @@ MISSING_CLOSING_TAG_ERROR_T* missing_closing_tag_error_init(token_T* opening_tag
179
192
  return missing_closing_tag_error;
180
193
  }
181
194
 
182
- void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
183
- hb_array_append(errors, missing_closing_tag_error_init(opening_tag, start, end, allocator));
195
+ void append_missing_closing_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
196
+ if (parser_options_errors_exceeded(options)) { return; }
197
+
198
+ hb_array_append_lazy(errors, missing_closing_tag_error_init(opening_tag, start, end, allocator), allocator);
199
+
200
+ parser_options_increment_error_count(options);
184
201
  }
185
202
 
186
203
  TAG_NAMES_MISMATCH_ERROR_T* tag_names_mismatch_error_init(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -220,8 +237,12 @@ TAG_NAMES_MISMATCH_ERROR_T* tag_names_mismatch_error_init(token_T* opening_tag,
220
237
  return tag_names_mismatch_error;
221
238
  }
222
239
 
223
- void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
224
- hb_array_append(errors, tag_names_mismatch_error_init(opening_tag, closing_tag, start, end, allocator));
240
+ void append_tag_names_mismatch_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
241
+ if (parser_options_errors_exceeded(options)) { return; }
242
+
243
+ hb_array_append_lazy(errors, tag_names_mismatch_error_init(opening_tag, closing_tag, start, end, allocator), allocator);
244
+
245
+ parser_options_increment_error_count(options);
225
246
  }
226
247
 
227
248
  VOID_ELEMENT_CLOSING_TAG_ERROR_T* void_element_closing_tag_error_init(token_T* tag_name, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -268,8 +289,12 @@ VOID_ELEMENT_CLOSING_TAG_ERROR_T* void_element_closing_tag_error_init(token_T* t
268
289
  return void_element_closing_tag_error;
269
290
  }
270
291
 
271
- void append_void_element_closing_tag_error(token_T* tag_name, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
272
- hb_array_append(errors, void_element_closing_tag_error_init(tag_name, expected, found, start, end, allocator));
292
+ void append_void_element_closing_tag_error(token_T* tag_name, hb_string_T expected, hb_string_T found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
293
+ if (parser_options_errors_exceeded(options)) { return; }
294
+
295
+ hb_array_append_lazy(errors, void_element_closing_tag_error_init(tag_name, expected, found, start, end, allocator), allocator);
296
+
297
+ parser_options_increment_error_count(options);
273
298
  }
274
299
 
275
300
  UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -301,8 +326,12 @@ UNCLOSED_ELEMENT_ERROR_T* unclosed_element_error_init(token_T* opening_tag, posi
301
326
  return unclosed_element_error;
302
327
  }
303
328
 
304
- void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
305
- hb_array_append(errors, unclosed_element_error_init(opening_tag, start, end, allocator));
329
+ void append_unclosed_element_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
330
+ if (parser_options_errors_exceeded(options)) { return; }
331
+
332
+ hb_array_append_lazy(errors, unclosed_element_error_init(opening_tag, start, end, allocator), allocator);
333
+
334
+ parser_options_increment_error_count(options);
306
335
  }
307
336
 
308
337
  RUBY_PARSE_ERROR_T* ruby_parse_error_init(hb_string_T error_message, hb_string_T diagnostic_id, hb_string_T level, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -339,8 +368,12 @@ RUBY_PARSE_ERROR_T* ruby_parse_error_init(hb_string_T error_message, hb_string_T
339
368
  return ruby_parse_error;
340
369
  }
341
370
 
342
- void append_ruby_parse_error(hb_string_T error_message, hb_string_T diagnostic_id, hb_string_T level, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
343
- hb_array_append(errors, ruby_parse_error_init(error_message, diagnostic_id, level, start, end, allocator));
371
+ void append_ruby_parse_error(hb_string_T error_message, hb_string_T diagnostic_id, hb_string_T level, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
372
+ if (parser_options_errors_exceeded(options)) { return; }
373
+
374
+ hb_array_append_lazy(errors, ruby_parse_error_init(error_message, diagnostic_id, level, start, end, allocator), allocator);
375
+
376
+ parser_options_increment_error_count(options);
344
377
  }
345
378
 
346
379
  ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -370,8 +403,12 @@ ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error_init(hb_string_T ke
370
403
  return erb_control_flow_scope_error;
371
404
  }
372
405
 
373
- void append_erb_control_flow_scope_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
374
- hb_array_append(errors, erb_control_flow_scope_error_init(keyword, start, end, allocator));
406
+ void append_erb_control_flow_scope_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
407
+ if (parser_options_errors_exceeded(options)) { return; }
408
+
409
+ hb_array_append_lazy(errors, erb_control_flow_scope_error_init(keyword, start, end, allocator), allocator);
410
+
411
+ parser_options_increment_error_count(options);
375
412
  }
376
413
 
377
414
  MISSING_ERB_END_TAG_ERROR_T* missing_erb_end_tag_error_init(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -401,8 +438,12 @@ MISSING_ERB_END_TAG_ERROR_T* missing_erb_end_tag_error_init(hb_string_T keyword,
401
438
  return missing_erb_end_tag_error;
402
439
  }
403
440
 
404
- void append_missing_erb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
405
- hb_array_append(errors, missing_erb_end_tag_error_init(keyword, start, end, allocator));
441
+ void append_missing_erb_end_tag_error(hb_string_T keyword, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
442
+ if (parser_options_errors_exceeded(options)) { return; }
443
+
444
+ hb_array_append_lazy(errors, missing_erb_end_tag_error_init(keyword, start, end, allocator), allocator);
445
+
446
+ parser_options_increment_error_count(options);
406
447
  }
407
448
 
408
449
  ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T* erb_multiple_blocks_in_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -417,8 +458,12 @@ ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T* erb_multiple_blocks_in_tag_error_init(positi
417
458
  return erb_multiple_blocks_in_tag_error;
418
459
  }
419
460
 
420
- void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
421
- hb_array_append(errors, erb_multiple_blocks_in_tag_error_init(start, end, allocator));
461
+ void append_erb_multiple_blocks_in_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
462
+ if (parser_options_errors_exceeded(options)) { return; }
463
+
464
+ hb_array_append_lazy(errors, erb_multiple_blocks_in_tag_error_init(start, end, allocator), allocator);
465
+
466
+ parser_options_increment_error_count(options);
422
467
  }
423
468
 
424
469
  ERB_CASE_WITH_CONDITIONS_ERROR_T* erb_case_with_conditions_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -428,13 +473,37 @@ ERB_CASE_WITH_CONDITIONS_ERROR_T* erb_case_with_conditions_error_init(position_T
428
473
 
429
474
  error_init(&erb_case_with_conditions_error->base, ERB_CASE_WITH_CONDITIONS_ERROR, start, end);
430
475
 
431
- erb_case_with_conditions_error->base.message = hb_string_copy(hb_string("A `case` statement with `when`/`in` conditions in a single ERB tag cannot be reliably parsed, compiled, and formatted. Use separate ERB tags for `case` and its conditions (e.g., `<% case x %>` followed by `<% when y %>`)."), allocator);
476
+ erb_case_with_conditions_error->base.message = hb_string_copy(hb_string("A `case` statement with `when`/`in` conditions in a single ERB tag cannot be reliably parsed, compiled, and formatted. Use separate ERB tags for `case` and its conditions (e.g., `<% case x %>` followed by `<% when y %>`), or set `strict: false` to allow this."), allocator);
432
477
 
433
478
  return erb_case_with_conditions_error;
434
479
  }
435
480
 
436
- void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
437
- hb_array_append(errors, erb_case_with_conditions_error_init(start, end, allocator));
481
+ void append_erb_case_with_conditions_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
482
+ if (parser_options_errors_exceeded(options)) { return; }
483
+
484
+ hb_array_append_lazy(errors, erb_case_with_conditions_error_init(start, end, allocator), allocator);
485
+
486
+ parser_options_increment_error_count(options);
487
+ }
488
+
489
+ ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T* erb_case_inline_pattern_match_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
490
+ ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T* erb_case_inline_pattern_match_error = hb_allocator_alloc(allocator, sizeof(ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T));
491
+
492
+ if (!erb_case_inline_pattern_match_error) { return NULL; }
493
+
494
+ error_init(&erb_case_inline_pattern_match_error->base, ERB_CASE_INLINE_PATTERN_MATCH_ERROR, start, end);
495
+
496
+ erb_case_inline_pattern_match_error->base.message = hb_string_copy(hb_string("A `case` statement and its first `in` pattern on the same line read as Ruby's one-line pattern match, not as a `case`/`in`. Put the `in` pattern on its own line, or in its own ERB tag (e.g., `<% case x %>` followed by `<% in y %>`)."), allocator);
497
+
498
+ return erb_case_inline_pattern_match_error;
499
+ }
500
+
501
+ void append_erb_case_inline_pattern_match_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
502
+ if (parser_options_errors_exceeded(options)) { return; }
503
+
504
+ hb_array_append_lazy(errors, erb_case_inline_pattern_match_error_init(start, end, allocator), allocator);
505
+
506
+ parser_options_increment_error_count(options);
438
507
  }
439
508
 
440
509
  CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T* conditional_element_multiple_tags_error_init(size_t line, size_t column, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -462,8 +531,12 @@ CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T* conditional_element_multiple_tags_err
462
531
  return conditional_element_multiple_tags_error;
463
532
  }
464
533
 
465
- void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
466
- hb_array_append(errors, conditional_element_multiple_tags_error_init(line, column, start, end, allocator));
534
+ void append_conditional_element_multiple_tags_error(size_t line, size_t column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
535
+ if (parser_options_errors_exceeded(options)) { return; }
536
+
537
+ hb_array_append_lazy(errors, conditional_element_multiple_tags_error_init(line, column, start, end, allocator), allocator);
538
+
539
+ parser_options_increment_error_count(options);
467
540
  }
468
541
 
469
542
  CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T* conditional_element_condition_mismatch_error_init(hb_string_T tag_name, hb_string_T open_condition, size_t open_line, size_t open_column, hb_string_T close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -513,8 +586,79 @@ CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T* conditional_element_condition_mi
513
586
  return conditional_element_condition_mismatch_error;
514
587
  }
515
588
 
516
- void append_conditional_element_condition_mismatch_error(hb_string_T tag_name, hb_string_T open_condition, size_t open_line, size_t open_column, hb_string_T close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
517
- hb_array_append(errors, conditional_element_condition_mismatch_error_init(tag_name, open_condition, open_line, open_column, close_condition, close_line, close_column, start, end, allocator));
589
+ void append_conditional_element_condition_mismatch_error(hb_string_T tag_name, hb_string_T open_condition, size_t open_line, size_t open_column, hb_string_T close_condition, size_t close_line, size_t close_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
590
+ if (parser_options_errors_exceeded(options)) { return; }
591
+
592
+ hb_array_append_lazy(errors, conditional_element_condition_mismatch_error_init(tag_name, open_condition, open_line, open_column, close_condition, close_line, close_column, start, end, allocator), allocator);
593
+
594
+ parser_options_increment_error_count(options);
595
+ }
596
+
597
+ UNCLOSED_COMMENT_ERROR_T* unclosed_comment_error_init(token_T* comment_start, position_T start, position_T end, hb_allocator_T* allocator) {
598
+ UNCLOSED_COMMENT_ERROR_T* unclosed_comment_error = hb_allocator_alloc(allocator, sizeof(UNCLOSED_COMMENT_ERROR_T));
599
+
600
+ if (!unclosed_comment_error) { return NULL; }
601
+
602
+ error_init(&unclosed_comment_error->base, UNCLOSED_COMMENT_ERROR, start, end);
603
+
604
+ const char* message_template = "Comment opened at (%u:%u) is missing its closing `-->`.";
605
+
606
+ char message[76];
607
+ snprintf(
608
+ message,
609
+ sizeof(message),
610
+ message_template,
611
+ comment_start->location.start.line,
612
+ comment_start->location.start.column
613
+ );
614
+
615
+ unclosed_comment_error->base.message = hb_string_copy(hb_string(message), allocator);
616
+
617
+ unclosed_comment_error->comment_start = token_copy(comment_start, allocator);
618
+ return unclosed_comment_error;
619
+ }
620
+
621
+ void append_unclosed_comment_error(token_T* comment_start, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
622
+ if (parser_options_errors_exceeded(options)) { return; }
623
+
624
+ hb_array_append_lazy(errors, unclosed_comment_error_init(comment_start, start, end, allocator), allocator);
625
+
626
+ parser_options_increment_error_count(options);
627
+ }
628
+
629
+ NESTED_COMMENT_ERROR_T* nested_comment_error_init(token_T* comment_start, token_T* nested_start, position_T start, position_T end, hb_allocator_T* allocator) {
630
+ NESTED_COMMENT_ERROR_T* nested_comment_error = hb_allocator_alloc(allocator, sizeof(NESTED_COMMENT_ERROR_T));
631
+
632
+ if (!nested_comment_error) { return NULL; }
633
+
634
+ error_init(&nested_comment_error->base, NESTED_COMMENT_ERROR, start, end);
635
+
636
+ const char* message_template = "Comment opened at (%u:%u) contains another `<!--` at (%u:%u).";
637
+
638
+ char message[102];
639
+ snprintf(
640
+ message,
641
+ sizeof(message),
642
+ message_template,
643
+ comment_start->location.start.line,
644
+ comment_start->location.start.column,
645
+ nested_start->location.start.line,
646
+ nested_start->location.start.column
647
+ );
648
+
649
+ nested_comment_error->base.message = hb_string_copy(hb_string(message), allocator);
650
+
651
+ nested_comment_error->comment_start = token_copy(comment_start, allocator);
652
+ nested_comment_error->nested_start = token_copy(nested_start, allocator);
653
+ return nested_comment_error;
654
+ }
655
+
656
+ void append_nested_comment_error(token_T* comment_start, token_T* nested_start, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
657
+ if (parser_options_errors_exceeded(options)) { return; }
658
+
659
+ hb_array_append_lazy(errors, nested_comment_error_init(comment_start, nested_start, start, end, allocator), allocator);
660
+
661
+ parser_options_increment_error_count(options);
518
662
  }
519
663
 
520
664
  INVALID_COMMENT_CLOSING_TAG_ERROR_T* invalid_comment_closing_tag_error_init(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -546,8 +690,12 @@ INVALID_COMMENT_CLOSING_TAG_ERROR_T* invalid_comment_closing_tag_error_init(toke
546
690
  return invalid_comment_closing_tag_error;
547
691
  }
548
692
 
549
- void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
550
- hb_array_append(errors, invalid_comment_closing_tag_error_init(closing_tag, start, end, allocator));
693
+ void append_invalid_comment_closing_tag_error(token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
694
+ if (parser_options_errors_exceeded(options)) { return; }
695
+
696
+ hb_array_append_lazy(errors, invalid_comment_closing_tag_error_init(closing_tag, start, end, allocator), allocator);
697
+
698
+ parser_options_increment_error_count(options);
551
699
  }
552
700
 
553
701
  OMITTED_CLOSING_TAG_ERROR_T* omitted_closing_tag_error_init(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -587,8 +735,12 @@ OMITTED_CLOSING_TAG_ERROR_T* omitted_closing_tag_error_init(token_T* opening_tag
587
735
  return omitted_closing_tag_error;
588
736
  }
589
737
 
590
- void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
591
- hb_array_append(errors, omitted_closing_tag_error_init(opening_tag, insertion_point, start, end, allocator));
738
+ void append_omitted_closing_tag_error(token_T* opening_tag, position_T insertion_point, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
739
+ if (parser_options_errors_exceeded(options)) { return; }
740
+
741
+ hb_array_append_lazy(errors, omitted_closing_tag_error_init(opening_tag, insertion_point, start, end, allocator), allocator);
742
+
743
+ parser_options_increment_error_count(options);
592
744
  }
593
745
 
594
746
  UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -620,8 +772,12 @@ UNCLOSED_OPEN_TAG_ERROR_T* unclosed_open_tag_error_init(token_T* tag_name, posit
620
772
  return unclosed_open_tag_error;
621
773
  }
622
774
 
623
- void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
624
- hb_array_append(errors, unclosed_open_tag_error_init(tag_name, start, end, allocator));
775
+ void append_unclosed_open_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
776
+ if (parser_options_errors_exceeded(options)) { return; }
777
+
778
+ hb_array_append_lazy(errors, unclosed_open_tag_error_init(tag_name, start, end, allocator), allocator);
779
+
780
+ parser_options_increment_error_count(options);
625
781
  }
626
782
 
627
783
  UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -653,8 +809,49 @@ UNCLOSED_CLOSE_TAG_ERROR_T* unclosed_close_tag_error_init(token_T* tag_name, pos
653
809
  return unclosed_close_tag_error;
654
810
  }
655
811
 
656
- void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
657
- hb_array_append(errors, unclosed_close_tag_error_init(tag_name, start, end, allocator));
812
+ void append_unclosed_close_tag_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
813
+ if (parser_options_errors_exceeded(options)) { return; }
814
+
815
+ hb_array_append_lazy(errors, unclosed_close_tag_error_init(tag_name, start, end, allocator), allocator);
816
+
817
+ parser_options_increment_error_count(options);
818
+ }
819
+
820
+ END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T* end_tag_with_trailing_solidus_error_init(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator) {
821
+ END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T* end_tag_with_trailing_solidus_error = hb_allocator_alloc(allocator, sizeof(END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T));
822
+
823
+ if (!end_tag_with_trailing_solidus_error) { return NULL; }
824
+
825
+ error_init(&end_tag_with_trailing_solidus_error->base, END_TAG_WITH_TRAILING_SOLIDUS_ERROR, start, end);
826
+
827
+ const char* message_template = "Closing tag `</%s>` at (%u:%u) ends with `/>` instead of `>`.";
828
+
829
+ hb_string_T truncated_argument_0 = hb_string_truncate(tag_name->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
830
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
831
+
832
+ char message[210];
833
+ snprintf(
834
+ message,
835
+ sizeof(message),
836
+ message_template,
837
+ truncated_c_string_0 ? truncated_c_string_0 : "",
838
+ tag_name->location.start.line,
839
+ tag_name->location.start.column
840
+ );
841
+
842
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
843
+ end_tag_with_trailing_solidus_error->base.message = hb_string_copy(hb_string(message), allocator);
844
+
845
+ end_tag_with_trailing_solidus_error->tag_name = token_copy(tag_name, allocator);
846
+ return end_tag_with_trailing_solidus_error;
847
+ }
848
+
849
+ void append_end_tag_with_trailing_solidus_error(token_T* tag_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
850
+ if (parser_options_errors_exceeded(options)) { return; }
851
+
852
+ hb_array_append_lazy(errors, end_tag_with_trailing_solidus_error_init(tag_name, start, end, allocator), allocator);
853
+
854
+ parser_options_increment_error_count(options);
658
855
  }
659
856
 
660
857
  UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -686,8 +883,12 @@ UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error_init(token_T* opening_quote, positi
686
883
  return unclosed_quote_error;
687
884
  }
688
885
 
689
- void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
690
- hb_array_append(errors, unclosed_quote_error_init(opening_quote, start, end, allocator));
886
+ void append_unclosed_quote_error(token_T* opening_quote, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
887
+ if (parser_options_errors_exceeded(options)) { return; }
888
+
889
+ hb_array_append_lazy(errors, unclosed_quote_error_init(opening_quote, start, end, allocator), allocator);
890
+
891
+ parser_options_increment_error_count(options);
691
892
  }
692
893
 
693
894
  MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -719,8 +920,187 @@ MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error_init(hb_string_T
719
920
  return missing_attribute_value_error;
720
921
  }
721
922
 
722
- void append_missing_attribute_value_error(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
723
- hb_array_append(errors, missing_attribute_value_error_init(attribute_name, start, end, allocator));
923
+ void append_missing_attribute_value_error(hb_string_T attribute_name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
924
+ if (parser_options_errors_exceeded(options)) { return; }
925
+
926
+ hb_array_append_lazy(errors, missing_attribute_value_error_init(attribute_name, start, end, allocator), allocator);
927
+
928
+ parser_options_increment_error_count(options);
929
+ }
930
+
931
+ MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T* missing_whitespace_between_attributes_error_init(token_T* found, position_T start, position_T end, hb_allocator_T* allocator) {
932
+ MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T* missing_whitespace_between_attributes_error = hb_allocator_alloc(allocator, sizeof(MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T));
933
+
934
+ if (!missing_whitespace_between_attributes_error) { return NULL; }
935
+
936
+ error_init(&missing_whitespace_between_attributes_error->base, MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR, start, end);
937
+
938
+ const char* message_template = "Missing whitespace between attributes at (%u:%u). `%s` is parsed as the start of a new attribute.";
939
+
940
+ hb_string_T truncated_argument_2 = hb_string_truncate(found->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
941
+ char* truncated_c_string_2 = hb_string_to_c_string_using_malloc(truncated_argument_2);
942
+
943
+ char message[246];
944
+ snprintf(
945
+ message,
946
+ sizeof(message),
947
+ message_template,
948
+ found->location.start.line,
949
+ found->location.start.column,
950
+ truncated_c_string_2 ? truncated_c_string_2 : ""
951
+ );
952
+
953
+ if (truncated_c_string_2) { free(truncated_c_string_2); }
954
+ missing_whitespace_between_attributes_error->base.message = hb_string_copy(hb_string(message), allocator);
955
+
956
+ missing_whitespace_between_attributes_error->found = token_copy(found, allocator);
957
+ return missing_whitespace_between_attributes_error;
958
+ }
959
+
960
+ void append_missing_whitespace_between_attributes_error(token_T* found, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
961
+ if (parser_options_errors_exceeded(options)) { return; }
962
+
963
+ hb_array_append_lazy(errors, missing_whitespace_between_attributes_error_init(found, start, end, allocator), allocator);
964
+
965
+ parser_options_increment_error_count(options);
966
+ }
967
+
968
+ UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T* unexpected_character_in_attribute_name_error_init(token_T* character, position_T start, position_T end, hb_allocator_T* allocator) {
969
+ UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T* unexpected_character_in_attribute_name_error = hb_allocator_alloc(allocator, sizeof(UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T));
970
+
971
+ if (!unexpected_character_in_attribute_name_error) { return NULL; }
972
+
973
+ error_init(&unexpected_character_in_attribute_name_error->base, UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR, start, end);
974
+
975
+ const char* message_template = "Unexpected `%s` in attribute name at (%u:%u).";
976
+
977
+ hb_string_T truncated_argument_0 = hb_string_truncate(character->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
978
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
979
+
980
+ char message[194];
981
+ snprintf(
982
+ message,
983
+ sizeof(message),
984
+ message_template,
985
+ truncated_c_string_0 ? truncated_c_string_0 : "",
986
+ character->location.start.line,
987
+ character->location.start.column
988
+ );
989
+
990
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
991
+ unexpected_character_in_attribute_name_error->base.message = hb_string_copy(hb_string(message), allocator);
992
+
993
+ unexpected_character_in_attribute_name_error->character = token_copy(character, allocator);
994
+ return unexpected_character_in_attribute_name_error;
995
+ }
996
+
997
+ void append_unexpected_character_in_attribute_name_error(token_T* character, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
998
+ if (parser_options_errors_exceeded(options)) { return; }
999
+
1000
+ hb_array_append_lazy(errors, unexpected_character_in_attribute_name_error_init(character, start, end, allocator), allocator);
1001
+
1002
+ parser_options_increment_error_count(options);
1003
+ }
1004
+
1005
+ UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T* unexpected_character_in_unquoted_attribute_value_error_init(token_T* character, position_T start, position_T end, hb_allocator_T* allocator) {
1006
+ UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T* unexpected_character_in_unquoted_attribute_value_error = hb_allocator_alloc(allocator, sizeof(UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T));
1007
+
1008
+ if (!unexpected_character_in_unquoted_attribute_value_error) { return NULL; }
1009
+
1010
+ error_init(&unexpected_character_in_unquoted_attribute_value_error->base, UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR, start, end);
1011
+
1012
+ const char* message_template = "Unexpected `%s` in unquoted attribute value at (%u:%u).";
1013
+
1014
+ hb_string_T truncated_argument_0 = hb_string_truncate(character->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
1015
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
1016
+
1017
+ char message[204];
1018
+ snprintf(
1019
+ message,
1020
+ sizeof(message),
1021
+ message_template,
1022
+ truncated_c_string_0 ? truncated_c_string_0 : "",
1023
+ character->location.start.line,
1024
+ character->location.start.column
1025
+ );
1026
+
1027
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
1028
+ unexpected_character_in_unquoted_attribute_value_error->base.message = hb_string_copy(hb_string(message), allocator);
1029
+
1030
+ unexpected_character_in_unquoted_attribute_value_error->character = token_copy(character, allocator);
1031
+ return unexpected_character_in_unquoted_attribute_value_error;
1032
+ }
1033
+
1034
+ void append_unexpected_character_in_unquoted_attribute_value_error(token_T* character, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1035
+ if (parser_options_errors_exceeded(options)) { return; }
1036
+
1037
+ hb_array_append_lazy(errors, unexpected_character_in_unquoted_attribute_value_error_init(character, start, end, allocator), allocator);
1038
+
1039
+ parser_options_increment_error_count(options);
1040
+ }
1041
+
1042
+ UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T* unexpected_equals_sign_before_attribute_name_error_init(token_T* equals, position_T start, position_T end, hb_allocator_T* allocator) {
1043
+ UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T* unexpected_equals_sign_before_attribute_name_error = hb_allocator_alloc(allocator, sizeof(UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T));
1044
+
1045
+ if (!unexpected_equals_sign_before_attribute_name_error) { return NULL; }
1046
+
1047
+ error_init(&unexpected_equals_sign_before_attribute_name_error->base, UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR, start, end);
1048
+
1049
+ const char* message_template = "Unexpected `=` before attribute name at (%u:%u).";
1050
+
1051
+ char message[69];
1052
+ snprintf(
1053
+ message,
1054
+ sizeof(message),
1055
+ message_template,
1056
+ equals->location.start.line,
1057
+ equals->location.start.column
1058
+ );
1059
+
1060
+ unexpected_equals_sign_before_attribute_name_error->base.message = hb_string_copy(hb_string(message), allocator);
1061
+
1062
+ unexpected_equals_sign_before_attribute_name_error->equals = token_copy(equals, allocator);
1063
+ return unexpected_equals_sign_before_attribute_name_error;
1064
+ }
1065
+
1066
+ void append_unexpected_equals_sign_before_attribute_name_error(token_T* equals, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1067
+ if (parser_options_errors_exceeded(options)) { return; }
1068
+
1069
+ hb_array_append_lazy(errors, unexpected_equals_sign_before_attribute_name_error_init(equals, start, end, allocator), allocator);
1070
+
1071
+ parser_options_increment_error_count(options);
1072
+ }
1073
+
1074
+ UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T* unexpected_solidus_in_tag_error_init(token_T* solidus, position_T start, position_T end, hb_allocator_T* allocator) {
1075
+ UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T* unexpected_solidus_in_tag_error = hb_allocator_alloc(allocator, sizeof(UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T));
1076
+
1077
+ if (!unexpected_solidus_in_tag_error) { return NULL; }
1078
+
1079
+ error_init(&unexpected_solidus_in_tag_error->base, UNEXPECTED_SOLIDUS_IN_TAG_ERROR, start, end);
1080
+
1081
+ const char* message_template = "Unexpected `/` in tag at (%u:%u).";
1082
+
1083
+ char message[54];
1084
+ snprintf(
1085
+ message,
1086
+ sizeof(message),
1087
+ message_template,
1088
+ solidus->location.start.line,
1089
+ solidus->location.start.column
1090
+ );
1091
+
1092
+ unexpected_solidus_in_tag_error->base.message = hb_string_copy(hb_string(message), allocator);
1093
+
1094
+ unexpected_solidus_in_tag_error->solidus = token_copy(solidus, allocator);
1095
+ return unexpected_solidus_in_tag_error;
1096
+ }
1097
+
1098
+ void append_unexpected_solidus_in_tag_error(token_T* solidus, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1099
+ if (parser_options_errors_exceeded(options)) { return; }
1100
+
1101
+ hb_array_append_lazy(errors, unexpected_solidus_in_tag_error_init(solidus, start, end, allocator), allocator);
1102
+
1103
+ parser_options_increment_error_count(options);
724
1104
  }
725
1105
 
726
1106
  UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error_init(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -752,8 +1132,57 @@ UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error_init(token_T* opening_tag, posi
752
1132
  return unclosed_erb_tag_error;
753
1133
  }
754
1134
 
755
- void append_unclosed_erb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
756
- hb_array_append(errors, unclosed_erb_tag_error_init(opening_tag, start, end, allocator));
1135
+ void append_unclosed_erb_tag_error(token_T* opening_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1136
+ if (parser_options_errors_exceeded(options)) { return; }
1137
+
1138
+ hb_array_append_lazy(errors, unclosed_erb_tag_error_init(opening_tag, start, end, allocator), allocator);
1139
+
1140
+ parser_options_increment_error_count(options);
1141
+ }
1142
+
1143
+ MALFORMED_ERB_CLOSING_TAG_ERROR_T* malformed_erb_closing_tag_error_init(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator) {
1144
+ MALFORMED_ERB_CLOSING_TAG_ERROR_T* malformed_erb_closing_tag_error = hb_allocator_alloc(allocator, sizeof(MALFORMED_ERB_CLOSING_TAG_ERROR_T));
1145
+
1146
+ if (!malformed_erb_closing_tag_error) { return NULL; }
1147
+
1148
+ error_init(&malformed_erb_closing_tag_error->base, MALFORMED_ERB_CLOSING_TAG_ERROR, start, end);
1149
+
1150
+ const char* message_template = "ERB tag `%s` at (%u:%u) is closed with `%s` at (%u:%u) instead of `%%>`.";
1151
+
1152
+ hb_string_T truncated_argument_0 = hb_string_truncate(opening_tag->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
1153
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
1154
+
1155
+ hb_string_T truncated_argument_3 = hb_string_truncate(closing_tag->value, ERROR_MESSAGES_TRUNCATED_LENGTH);
1156
+ char* truncated_c_string_3 = hb_string_to_c_string_using_malloc(truncated_argument_3);
1157
+
1158
+ char message[369];
1159
+ snprintf(
1160
+ message,
1161
+ sizeof(message),
1162
+ message_template,
1163
+ truncated_c_string_0 ? truncated_c_string_0 : "",
1164
+ opening_tag->location.start.line,
1165
+ opening_tag->location.start.column,
1166
+ truncated_c_string_3 ? truncated_c_string_3 : "",
1167
+ closing_tag->location.start.line,
1168
+ closing_tag->location.start.column
1169
+ );
1170
+
1171
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
1172
+ if (truncated_c_string_3) { free(truncated_c_string_3); }
1173
+ malformed_erb_closing_tag_error->base.message = hb_string_copy(hb_string(message), allocator);
1174
+
1175
+ malformed_erb_closing_tag_error->opening_tag = token_copy(opening_tag, allocator);
1176
+ malformed_erb_closing_tag_error->closing_tag = token_copy(closing_tag, allocator);
1177
+ return malformed_erb_closing_tag_error;
1178
+ }
1179
+
1180
+ void append_malformed_erb_closing_tag_error(token_T* opening_tag, token_T* closing_tag, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1181
+ if (parser_options_errors_exceeded(options)) { return; }
1182
+
1183
+ hb_array_append_lazy(errors, malformed_erb_closing_tag_error_init(opening_tag, closing_tag, start, end, allocator), allocator);
1184
+
1185
+ parser_options_increment_error_count(options);
757
1186
  }
758
1187
 
759
1188
  STRAY_ERB_CLOSING_TAG_ERROR_T* stray_erb_closing_tag_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -779,8 +1208,12 @@ STRAY_ERB_CLOSING_TAG_ERROR_T* stray_erb_closing_tag_error_init(position_T start
779
1208
  return stray_erb_closing_tag_error;
780
1209
  }
781
1210
 
782
- void append_stray_erb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
783
- hb_array_append(errors, stray_erb_closing_tag_error_init(start, end, allocator));
1211
+ void append_stray_erb_closing_tag_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1212
+ if (parser_options_errors_exceeded(options)) { return; }
1213
+
1214
+ hb_array_append_lazy(errors, stray_erb_closing_tag_error_init(start, end, allocator), allocator);
1215
+
1216
+ parser_options_increment_error_count(options);
784
1217
  }
785
1218
 
786
1219
  NESTED_ERB_TAG_ERROR_T* nested_erb_tag_error_init(token_T* opening_tag, size_t nested_tag_line, size_t nested_tag_column, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -816,8 +1249,12 @@ NESTED_ERB_TAG_ERROR_T* nested_erb_tag_error_init(token_T* opening_tag, size_t n
816
1249
  return nested_erb_tag_error;
817
1250
  }
818
1251
 
819
- void append_nested_erb_tag_error(token_T* opening_tag, size_t nested_tag_line, size_t nested_tag_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
820
- hb_array_append(errors, nested_erb_tag_error_init(opening_tag, nested_tag_line, nested_tag_column, start, end, allocator));
1252
+ void append_nested_erb_tag_error(token_T* opening_tag, size_t nested_tag_line, size_t nested_tag_column, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1253
+ if (parser_options_errors_exceeded(options)) { return; }
1254
+
1255
+ hb_array_append_lazy(errors, nested_erb_tag_error_init(opening_tag, nested_tag_line, nested_tag_column, start, end, allocator), allocator);
1256
+
1257
+ parser_options_increment_error_count(options);
821
1258
  }
822
1259
 
823
1260
  RENDER_AMBIGUOUS_LOCALS_ERROR_T* render_ambiguous_locals_error_init(hb_string_T partial, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -852,8 +1289,12 @@ RENDER_AMBIGUOUS_LOCALS_ERROR_T* render_ambiguous_locals_error_init(hb_string_T
852
1289
  return render_ambiguous_locals_error;
853
1290
  }
854
1291
 
855
- void append_render_ambiguous_locals_error(hb_string_T partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
856
- hb_array_append(errors, render_ambiguous_locals_error_init(partial, start, end, allocator));
1292
+ void append_render_ambiguous_locals_error(hb_string_T partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1293
+ if (parser_options_errors_exceeded(options)) { return; }
1294
+
1295
+ hb_array_append_lazy(errors, render_ambiguous_locals_error_init(partial, start, end, allocator), allocator);
1296
+
1297
+ parser_options_increment_error_count(options);
857
1298
  }
858
1299
 
859
1300
  RENDER_MISSING_LOCALS_ERROR_T* render_missing_locals_error_init(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -894,8 +1335,12 @@ RENDER_MISSING_LOCALS_ERROR_T* render_missing_locals_error_init(hb_string_T part
894
1335
  return render_missing_locals_error;
895
1336
  }
896
1337
 
897
- void append_render_missing_locals_error(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
898
- hb_array_append(errors, render_missing_locals_error_init(partial, keywords, start, end, allocator));
1338
+ void append_render_missing_locals_error(hb_string_T partial, hb_string_T keywords, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1339
+ if (parser_options_errors_exceeded(options)) { return; }
1340
+
1341
+ hb_array_append_lazy(errors, render_missing_locals_error_init(partial, keywords, start, end, allocator), allocator);
1342
+
1343
+ parser_options_increment_error_count(options);
899
1344
  }
900
1345
 
901
1346
  RENDER_NO_ARGUMENTS_ERROR_T* render_no_arguments_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -910,8 +1355,12 @@ RENDER_NO_ARGUMENTS_ERROR_T* render_no_arguments_error_init(position_T start, po
910
1355
  return render_no_arguments_error;
911
1356
  }
912
1357
 
913
- void append_render_no_arguments_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
914
- hb_array_append(errors, render_no_arguments_error_init(start, end, allocator));
1358
+ void append_render_no_arguments_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1359
+ if (parser_options_errors_exceeded(options)) { return; }
1360
+
1361
+ hb_array_append_lazy(errors, render_no_arguments_error_init(start, end, allocator), allocator);
1362
+
1363
+ parser_options_increment_error_count(options);
915
1364
  }
916
1365
 
917
1366
  RENDER_CONFLICTING_PARTIAL_ERROR_T* render_conflicting_partial_error_init(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -947,8 +1396,12 @@ RENDER_CONFLICTING_PARTIAL_ERROR_T* render_conflicting_partial_error_init(hb_str
947
1396
  return render_conflicting_partial_error;
948
1397
  }
949
1398
 
950
- void append_render_conflicting_partial_error(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
951
- hb_array_append(errors, render_conflicting_partial_error_init(positional_partial, keyword_partial, start, end, allocator));
1399
+ void append_render_conflicting_partial_error(hb_string_T positional_partial, hb_string_T keyword_partial, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1400
+ if (parser_options_errors_exceeded(options)) { return; }
1401
+
1402
+ hb_array_append_lazy(errors, render_conflicting_partial_error_init(positional_partial, keyword_partial, start, end, allocator), allocator);
1403
+
1404
+ parser_options_increment_error_count(options);
952
1405
  }
953
1406
 
954
1407
  RENDER_INVALID_AS_OPTION_ERROR_T* render_invalid_as_option_error_init(hb_string_T as_value, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -978,8 +1431,12 @@ RENDER_INVALID_AS_OPTION_ERROR_T* render_invalid_as_option_error_init(hb_string_
978
1431
  return render_invalid_as_option_error;
979
1432
  }
980
1433
 
981
- void append_render_invalid_as_option_error(hb_string_T as_value, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
982
- hb_array_append(errors, render_invalid_as_option_error_init(as_value, start, end, allocator));
1434
+ void append_render_invalid_as_option_error(hb_string_T as_value, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1435
+ if (parser_options_errors_exceeded(options)) { return; }
1436
+
1437
+ hb_array_append_lazy(errors, render_invalid_as_option_error_init(as_value, start, end, allocator), allocator);
1438
+
1439
+ parser_options_increment_error_count(options);
983
1440
  }
984
1441
 
985
1442
  RENDER_OBJECT_AND_COLLECTION_ERROR_T* render_object_and_collection_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -994,8 +1451,12 @@ RENDER_OBJECT_AND_COLLECTION_ERROR_T* render_object_and_collection_error_init(po
994
1451
  return render_object_and_collection_error;
995
1452
  }
996
1453
 
997
- void append_render_object_and_collection_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
998
- hb_array_append(errors, render_object_and_collection_error_init(start, end, allocator));
1454
+ void append_render_object_and_collection_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1455
+ if (parser_options_errors_exceeded(options)) { return; }
1456
+
1457
+ hb_array_append_lazy(errors, render_object_and_collection_error_init(start, end, allocator), allocator);
1458
+
1459
+ parser_options_increment_error_count(options);
999
1460
  }
1000
1461
 
1001
1462
  RENDER_LAYOUT_WITHOUT_BLOCK_ERROR_T* render_layout_without_block_error_init(hb_string_T layout, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1025,8 +1486,12 @@ RENDER_LAYOUT_WITHOUT_BLOCK_ERROR_T* render_layout_without_block_error_init(hb_s
1025
1486
  return render_layout_without_block_error;
1026
1487
  }
1027
1488
 
1028
- void append_render_layout_without_block_error(hb_string_T layout, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1029
- hb_array_append(errors, render_layout_without_block_error_init(layout, start, end, allocator));
1489
+ void append_render_layout_without_block_error(hb_string_T layout, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1490
+ if (parser_options_errors_exceeded(options)) { return; }
1491
+
1492
+ hb_array_append_lazy(errors, render_layout_without_block_error_init(layout, start, end, allocator), allocator);
1493
+
1494
+ parser_options_increment_error_count(options);
1030
1495
  }
1031
1496
 
1032
1497
  STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR_T* strict_locals_positional_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1061,8 +1526,12 @@ STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR_T* strict_locals_positional_argument_err
1061
1526
  return strict_locals_positional_argument_error;
1062
1527
  }
1063
1528
 
1064
- void append_strict_locals_positional_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1065
- hb_array_append(errors, strict_locals_positional_argument_error_init(name, start, end, allocator));
1529
+ void append_strict_locals_positional_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1530
+ if (parser_options_errors_exceeded(options)) { return; }
1531
+
1532
+ hb_array_append_lazy(errors, strict_locals_positional_argument_error_init(name, start, end, allocator), allocator);
1533
+
1534
+ parser_options_increment_error_count(options);
1066
1535
  }
1067
1536
 
1068
1537
  STRICT_LOCALS_BLOCK_ARGUMENT_ERROR_T* strict_locals_block_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1092,8 +1561,12 @@ STRICT_LOCALS_BLOCK_ARGUMENT_ERROR_T* strict_locals_block_argument_error_init(hb
1092
1561
  return strict_locals_block_argument_error;
1093
1562
  }
1094
1563
 
1095
- void append_strict_locals_block_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1096
- hb_array_append(errors, strict_locals_block_argument_error_init(name, start, end, allocator));
1564
+ void append_strict_locals_block_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1565
+ if (parser_options_errors_exceeded(options)) { return; }
1566
+
1567
+ hb_array_append_lazy(errors, strict_locals_block_argument_error_init(name, start, end, allocator), allocator);
1568
+
1569
+ parser_options_increment_error_count(options);
1097
1570
  }
1098
1571
 
1099
1572
  STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T* strict_locals_splat_argument_error_init(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1123,8 +1596,12 @@ STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T* strict_locals_splat_argument_error_init(hb
1123
1596
  return strict_locals_splat_argument_error;
1124
1597
  }
1125
1598
 
1126
- void append_strict_locals_splat_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1127
- hb_array_append(errors, strict_locals_splat_argument_error_init(name, start, end, allocator));
1599
+ void append_strict_locals_splat_argument_error(hb_string_T name, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1600
+ if (parser_options_errors_exceeded(options)) { return; }
1601
+
1602
+ hb_array_append_lazy(errors, strict_locals_splat_argument_error_init(name, start, end, allocator), allocator);
1603
+
1604
+ parser_options_increment_error_count(options);
1128
1605
  }
1129
1606
 
1130
1607
  STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_error_init(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1154,8 +1631,12 @@ STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_err
1154
1631
  return strict_locals_missing_parenthesis_error;
1155
1632
  }
1156
1633
 
1157
- void append_strict_locals_missing_parenthesis_error(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1158
- hb_array_append(errors, strict_locals_missing_parenthesis_error_init(rest, start, end, allocator));
1634
+ void append_strict_locals_missing_parenthesis_error(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1635
+ if (parser_options_errors_exceeded(options)) { return; }
1636
+
1637
+ hb_array_append_lazy(errors, strict_locals_missing_parenthesis_error_init(rest, start, end, allocator), allocator);
1638
+
1639
+ parser_options_increment_error_count(options);
1159
1640
  }
1160
1641
 
1161
1642
  STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T* strict_locals_duplicate_declaration_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1165,13 +1646,148 @@ STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T* strict_locals_duplicate_declaration
1165
1646
 
1166
1647
  error_init(&strict_locals_duplicate_declaration_error->base, STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR, start, end);
1167
1648
 
1168
- strict_locals_duplicate_declaration_error->base.message = hb_string_copy(hb_string("Duplicate strict locals declaration. Only the first `<%# locals: (...) %>` declaration is used by Rails."), allocator);
1649
+ strict_locals_duplicate_declaration_error->base.message = hb_string_copy(hb_string("Duplicate strict locals declaration. Only the first `<%# locals: (...) %>` declaration is used by Rails."), allocator);
1650
+
1651
+ return strict_locals_duplicate_declaration_error;
1652
+ }
1653
+
1654
+ void append_strict_locals_duplicate_declaration_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1655
+ if (parser_options_errors_exceeded(options)) { return; }
1656
+
1657
+ hb_array_append_lazy(errors, strict_locals_duplicate_declaration_error_init(start, end, allocator), allocator);
1658
+
1659
+ parser_options_increment_error_count(options);
1660
+ }
1661
+
1662
+ HERB_STATE_MISSING_PARENTHESIS_ERROR_T* herb_state_missing_parenthesis_error_init(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator) {
1663
+ HERB_STATE_MISSING_PARENTHESIS_ERROR_T* herb_state_missing_parenthesis_error = hb_allocator_alloc(allocator, sizeof(HERB_STATE_MISSING_PARENTHESIS_ERROR_T));
1664
+
1665
+ if (!herb_state_missing_parenthesis_error) { return NULL; }
1666
+
1667
+ error_init(&herb_state_missing_parenthesis_error->base, HERB_STATE_MISSING_PARENTHESIS_ERROR, start, end);
1668
+
1669
+ const char* message_template = "The `herb:state` directive requires parentheses. Expected `herb:state (...)` but got `herb:state %s`.";
1670
+
1671
+ hb_string_T truncated_argument_0 = hb_string_truncate(rest, ERROR_MESSAGES_TRUNCATED_LENGTH);
1672
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
1673
+
1674
+ char message[230];
1675
+ snprintf(
1676
+ message,
1677
+ sizeof(message),
1678
+ message_template,
1679
+ truncated_c_string_0 ? truncated_c_string_0 : ""
1680
+ );
1681
+
1682
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
1683
+ herb_state_missing_parenthesis_error->base.message = hb_string_copy(hb_string(message), allocator);
1684
+
1685
+ herb_state_missing_parenthesis_error->rest = hb_string_copy(rest, allocator);
1686
+ return herb_state_missing_parenthesis_error;
1687
+ }
1688
+
1689
+ void append_herb_state_missing_parenthesis_error(hb_string_T rest, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1690
+ if (parser_options_errors_exceeded(options)) { return; }
1691
+
1692
+ hb_array_append_lazy(errors, herb_state_missing_parenthesis_error_init(rest, start, end, allocator), allocator);
1693
+
1694
+ parser_options_increment_error_count(options);
1695
+ }
1696
+
1697
+ HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T* herb_state_non_canonical_directive_error_init(hb_string_T found, hb_string_T expected, position_T start, position_T end, hb_allocator_T* allocator) {
1698
+ HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T* herb_state_non_canonical_directive_error = hb_allocator_alloc(allocator, sizeof(HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T));
1699
+
1700
+ if (!herb_state_non_canonical_directive_error) { return NULL; }
1701
+
1702
+ error_init(&herb_state_non_canonical_directive_error->base, HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR, start, end);
1703
+
1704
+ const char* message_template = "The `herb:state` directive has to be spelled `<%%# herb:state (...) %%>`. Found `%s` where `%s` was expected.";
1705
+
1706
+ hb_string_T truncated_argument_0 = hb_string_truncate(found, ERROR_MESSAGES_TRUNCATED_LENGTH);
1707
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
1708
+
1709
+ hb_string_T truncated_argument_1 = hb_string_truncate(expected, ERROR_MESSAGES_TRUNCATED_LENGTH);
1710
+ char* truncated_c_string_1 = hb_string_to_c_string_using_malloc(truncated_argument_1);
1711
+
1712
+ char message[366];
1713
+ snprintf(
1714
+ message,
1715
+ sizeof(message),
1716
+ message_template,
1717
+ truncated_c_string_0 ? truncated_c_string_0 : "",
1718
+ truncated_c_string_1 ? truncated_c_string_1 : ""
1719
+ );
1720
+
1721
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
1722
+ if (truncated_c_string_1) { free(truncated_c_string_1); }
1723
+ herb_state_non_canonical_directive_error->base.message = hb_string_copy(hb_string(message), allocator);
1724
+
1725
+ herb_state_non_canonical_directive_error->found = hb_string_copy(found, allocator);
1726
+ herb_state_non_canonical_directive_error->expected = hb_string_copy(expected, allocator);
1727
+ return herb_state_non_canonical_directive_error;
1728
+ }
1729
+
1730
+ void append_herb_state_non_canonical_directive_error(hb_string_T found, hb_string_T expected, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1731
+ if (parser_options_errors_exceeded(options)) { return; }
1732
+
1733
+ hb_array_append_lazy(errors, herb_state_non_canonical_directive_error_init(found, expected, start, end, allocator), allocator);
1734
+
1735
+ parser_options_increment_error_count(options);
1736
+ }
1737
+
1738
+ HERB_STATE_INVALID_PARAMETER_ERROR_T* herb_state_invalid_parameter_error_init(hb_string_T parameter, position_T start, position_T end, hb_allocator_T* allocator) {
1739
+ HERB_STATE_INVALID_PARAMETER_ERROR_T* herb_state_invalid_parameter_error = hb_allocator_alloc(allocator, sizeof(HERB_STATE_INVALID_PARAMETER_ERROR_T));
1740
+
1741
+ if (!herb_state_invalid_parameter_error) { return NULL; }
1742
+
1743
+ error_init(&herb_state_invalid_parameter_error->base, HERB_STATE_INVALID_PARAMETER_ERROR, start, end);
1744
+
1745
+ const char* message_template = "The `herb:state` directive only declares keyword arguments with defaults. `%s` is not one. Declare each state with a default, like `(pending: false)`.";
1746
+
1747
+ hb_string_T truncated_argument_0 = hb_string_truncate(parameter, ERROR_MESSAGES_TRUNCATED_LENGTH);
1748
+ char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
1749
+
1750
+ char message[279];
1751
+ snprintf(
1752
+ message,
1753
+ sizeof(message),
1754
+ message_template,
1755
+ truncated_c_string_0 ? truncated_c_string_0 : ""
1756
+ );
1757
+
1758
+ if (truncated_c_string_0) { free(truncated_c_string_0); }
1759
+ herb_state_invalid_parameter_error->base.message = hb_string_copy(hb_string(message), allocator);
1760
+
1761
+ herb_state_invalid_parameter_error->parameter = hb_string_copy(parameter, allocator);
1762
+ return herb_state_invalid_parameter_error;
1763
+ }
1764
+
1765
+ void append_herb_state_invalid_parameter_error(hb_string_T parameter, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1766
+ if (parser_options_errors_exceeded(options)) { return; }
1767
+
1768
+ hb_array_append_lazy(errors, herb_state_invalid_parameter_error_init(parameter, start, end, allocator), allocator);
1769
+
1770
+ parser_options_increment_error_count(options);
1771
+ }
1772
+
1773
+ HERB_STATE_DUPLICATE_DECLARATION_ERROR_T* herb_state_duplicate_declaration_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
1774
+ HERB_STATE_DUPLICATE_DECLARATION_ERROR_T* herb_state_duplicate_declaration_error = hb_allocator_alloc(allocator, sizeof(HERB_STATE_DUPLICATE_DECLARATION_ERROR_T));
1775
+
1776
+ if (!herb_state_duplicate_declaration_error) { return NULL; }
1777
+
1778
+ error_init(&herb_state_duplicate_declaration_error->base, HERB_STATE_DUPLICATE_DECLARATION_ERROR, start, end);
1779
+
1780
+ herb_state_duplicate_declaration_error->base.message = hb_string_copy(hb_string("This scope already declares its states. Merge these states into the first `<%# herb:state (...) %>` directive of the scope, so every state of the scope reads from one declaration."), allocator);
1169
1781
 
1170
- return strict_locals_duplicate_declaration_error;
1782
+ return herb_state_duplicate_declaration_error;
1171
1783
  }
1172
1784
 
1173
- void append_strict_locals_duplicate_declaration_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1174
- hb_array_append(errors, strict_locals_duplicate_declaration_error_init(start, end, allocator));
1785
+ void append_herb_state_duplicate_declaration_error(position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1786
+ if (parser_options_errors_exceeded(options)) { return; }
1787
+
1788
+ hb_array_append_lazy(errors, herb_state_duplicate_declaration_error_init(start, end, allocator), allocator);
1789
+
1790
+ parser_options_increment_error_count(options);
1175
1791
  }
1176
1792
 
1177
1793
  VOID_ELEMENT_CONTENT_ERROR_T* void_element_content_error_init(token_T* tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1213,8 +1829,12 @@ VOID_ELEMENT_CONTENT_ERROR_T* void_element_content_error_init(token_T* tag_name,
1213
1829
  return void_element_content_error;
1214
1830
  }
1215
1831
 
1216
- void append_void_element_content_error(token_T* tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1217
- hb_array_append(errors, void_element_content_error_init(tag_name, helper_name, content_type, start, end, allocator));
1832
+ void append_void_element_content_error(token_T* tag_name, hb_string_T helper_name, hb_string_T content_type, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1833
+ if (parser_options_errors_exceeded(options)) { return; }
1834
+
1835
+ hb_array_append_lazy(errors, void_element_content_error_init(tag_name, helper_name, content_type, start, end, allocator), allocator);
1836
+
1837
+ parser_options_increment_error_count(options);
1218
1838
  }
1219
1839
 
1220
1840
  DOT_NOTATION_CASING_ERROR_T* dot_notation_casing_error_init(token_T* segment, position_T start, position_T end, hb_allocator_T* allocator) {
@@ -1244,8 +1864,43 @@ DOT_NOTATION_CASING_ERROR_T* dot_notation_casing_error_init(token_T* segment, po
1244
1864
  return dot_notation_casing_error;
1245
1865
  }
1246
1866
 
1247
- void append_dot_notation_casing_error(token_T* segment, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T* errors) {
1248
- hb_array_append(errors, dot_notation_casing_error_init(segment, start, end, allocator));
1867
+ void append_dot_notation_casing_error(token_T* segment, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1868
+ if (parser_options_errors_exceeded(options)) { return; }
1869
+
1870
+ hb_array_append_lazy(errors, dot_notation_casing_error_init(segment, start, end, allocator), allocator);
1871
+
1872
+ parser_options_increment_error_count(options);
1873
+ }
1874
+
1875
+ TIMEOUT_ERROR_T* timeout_error_init(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator) {
1876
+ TIMEOUT_ERROR_T* timeout_error = hb_allocator_alloc(allocator, sizeof(TIMEOUT_ERROR_T));
1877
+
1878
+ if (!timeout_error) { return NULL; }
1879
+
1880
+ error_init(&timeout_error->base, TIMEOUT_ERROR, start, end);
1881
+
1882
+ const char* message_template = "Parsing timed out after %zu ms.";
1883
+
1884
+ char message[52];
1885
+ snprintf(
1886
+ message,
1887
+ sizeof(message),
1888
+ message_template,
1889
+ timeout_ms
1890
+ );
1891
+
1892
+ timeout_error->base.message = hb_string_copy(hb_string(message), allocator);
1893
+
1894
+ timeout_error->timeout_ms = timeout_ms;
1895
+ return timeout_error;
1896
+ }
1897
+
1898
+ void append_timeout_error(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T** errors, const struct PARSER_OPTIONS_STRUCT* options) {
1899
+ if (parser_options_errors_exceeded(options)) { return; }
1900
+
1901
+ hb_array_append_lazy(errors, timeout_error_init(timeout_ms, start, end, allocator), allocator);
1902
+
1903
+ parser_options_increment_error_count(options);
1249
1904
  }
1250
1905
 
1251
1906
  hb_string_T error_type_to_string(ERROR_T* error) {
@@ -1262,15 +1917,25 @@ hb_string_T error_type_to_string(ERROR_T* error) {
1262
1917
  case MISSING_ERB_END_TAG_ERROR: return hb_string("MISSING_ERB_END_TAG_ERROR");
1263
1918
  case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: return hb_string("ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR");
1264
1919
  case ERB_CASE_WITH_CONDITIONS_ERROR: return hb_string("ERB_CASE_WITH_CONDITIONS_ERROR");
1920
+ case ERB_CASE_INLINE_PATTERN_MATCH_ERROR: return hb_string("ERB_CASE_INLINE_PATTERN_MATCH_ERROR");
1265
1921
  case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: return hb_string("CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR");
1266
1922
  case CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR: return hb_string("CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR");
1923
+ case UNCLOSED_COMMENT_ERROR: return hb_string("UNCLOSED_COMMENT_ERROR");
1924
+ case NESTED_COMMENT_ERROR: return hb_string("NESTED_COMMENT_ERROR");
1267
1925
  case INVALID_COMMENT_CLOSING_TAG_ERROR: return hb_string("INVALID_COMMENT_CLOSING_TAG_ERROR");
1268
1926
  case OMITTED_CLOSING_TAG_ERROR: return hb_string("OMITTED_CLOSING_TAG_ERROR");
1269
1927
  case UNCLOSED_OPEN_TAG_ERROR: return hb_string("UNCLOSED_OPEN_TAG_ERROR");
1270
1928
  case UNCLOSED_CLOSE_TAG_ERROR: return hb_string("UNCLOSED_CLOSE_TAG_ERROR");
1929
+ case END_TAG_WITH_TRAILING_SOLIDUS_ERROR: return hb_string("END_TAG_WITH_TRAILING_SOLIDUS_ERROR");
1271
1930
  case UNCLOSED_QUOTE_ERROR: return hb_string("UNCLOSED_QUOTE_ERROR");
1272
1931
  case MISSING_ATTRIBUTE_VALUE_ERROR: return hb_string("MISSING_ATTRIBUTE_VALUE_ERROR");
1932
+ case MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR: return hb_string("MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR");
1933
+ case UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR: return hb_string("UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR");
1934
+ case UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR: return hb_string("UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR");
1935
+ case UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR: return hb_string("UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR");
1936
+ case UNEXPECTED_SOLIDUS_IN_TAG_ERROR: return hb_string("UNEXPECTED_SOLIDUS_IN_TAG_ERROR");
1273
1937
  case UNCLOSED_ERB_TAG_ERROR: return hb_string("UNCLOSED_ERB_TAG_ERROR");
1938
+ case MALFORMED_ERB_CLOSING_TAG_ERROR: return hb_string("MALFORMED_ERB_CLOSING_TAG_ERROR");
1274
1939
  case STRAY_ERB_CLOSING_TAG_ERROR: return hb_string("STRAY_ERB_CLOSING_TAG_ERROR");
1275
1940
  case NESTED_ERB_TAG_ERROR: return hb_string("NESTED_ERB_TAG_ERROR");
1276
1941
  case RENDER_AMBIGUOUS_LOCALS_ERROR: return hb_string("RENDER_AMBIGUOUS_LOCALS_ERROR");
@@ -1285,8 +1950,13 @@ hb_string_T error_type_to_string(ERROR_T* error) {
1285
1950
  case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: return hb_string("STRICT_LOCALS_SPLAT_ARGUMENT_ERROR");
1286
1951
  case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: return hb_string("STRICT_LOCALS_MISSING_PARENTHESIS_ERROR");
1287
1952
  case STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR: return hb_string("STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR");
1953
+ case HERB_STATE_MISSING_PARENTHESIS_ERROR: return hb_string("HERB_STATE_MISSING_PARENTHESIS_ERROR");
1954
+ case HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR: return hb_string("HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR");
1955
+ case HERB_STATE_INVALID_PARAMETER_ERROR: return hb_string("HERB_STATE_INVALID_PARAMETER_ERROR");
1956
+ case HERB_STATE_DUPLICATE_DECLARATION_ERROR: return hb_string("HERB_STATE_DUPLICATE_DECLARATION_ERROR");
1288
1957
  case VOID_ELEMENT_CONTENT_ERROR: return hb_string("VOID_ELEMENT_CONTENT_ERROR");
1289
1958
  case DOT_NOTATION_CASING_ERROR: return hb_string("DOT_NOTATION_CASING_ERROR");
1959
+ case TIMEOUT_ERROR: return hb_string("TIMEOUT_ERROR");
1290
1960
  }
1291
1961
 
1292
1962
  return hb_string("Unknown error_type_T");
@@ -1306,15 +1976,25 @@ hb_string_T error_human_type(ERROR_T* error) {
1306
1976
  case MISSING_ERB_END_TAG_ERROR: return hb_string("MissingERBEndTagError");
1307
1977
  case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: return hb_string("ERBMultipleBlocksInTagError");
1308
1978
  case ERB_CASE_WITH_CONDITIONS_ERROR: return hb_string("ERBCaseWithConditionsError");
1979
+ case ERB_CASE_INLINE_PATTERN_MATCH_ERROR: return hb_string("ERBCaseInlinePatternMatchError");
1309
1980
  case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: return hb_string("ConditionalElementMultipleTagsError");
1310
1981
  case CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR: return hb_string("ConditionalElementConditionMismatchError");
1982
+ case UNCLOSED_COMMENT_ERROR: return hb_string("UnclosedCommentError");
1983
+ case NESTED_COMMENT_ERROR: return hb_string("NestedCommentError");
1311
1984
  case INVALID_COMMENT_CLOSING_TAG_ERROR: return hb_string("InvalidCommentClosingTagError");
1312
1985
  case OMITTED_CLOSING_TAG_ERROR: return hb_string("OmittedClosingTagError");
1313
1986
  case UNCLOSED_OPEN_TAG_ERROR: return hb_string("UnclosedOpenTagError");
1314
1987
  case UNCLOSED_CLOSE_TAG_ERROR: return hb_string("UnclosedCloseTagError");
1988
+ case END_TAG_WITH_TRAILING_SOLIDUS_ERROR: return hb_string("EndTagWithTrailingSolidusError");
1315
1989
  case UNCLOSED_QUOTE_ERROR: return hb_string("UnclosedQuoteError");
1316
1990
  case MISSING_ATTRIBUTE_VALUE_ERROR: return hb_string("MissingAttributeValueError");
1991
+ case MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR: return hb_string("MissingWhitespaceBetweenAttributesError");
1992
+ case UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR: return hb_string("UnexpectedCharacterInAttributeNameError");
1993
+ case UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR: return hb_string("UnexpectedCharacterInUnquotedAttributeValueError");
1994
+ case UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR: return hb_string("UnexpectedEqualsSignBeforeAttributeNameError");
1995
+ case UNEXPECTED_SOLIDUS_IN_TAG_ERROR: return hb_string("UnexpectedSolidusInTagError");
1317
1996
  case UNCLOSED_ERB_TAG_ERROR: return hb_string("UnclosedERBTagError");
1997
+ case MALFORMED_ERB_CLOSING_TAG_ERROR: return hb_string("MalformedERBClosingTagError");
1318
1998
  case STRAY_ERB_CLOSING_TAG_ERROR: return hb_string("StrayERBClosingTagError");
1319
1999
  case NESTED_ERB_TAG_ERROR: return hb_string("NestedERBTagError");
1320
2000
  case RENDER_AMBIGUOUS_LOCALS_ERROR: return hb_string("RenderAmbiguousLocalsError");
@@ -1329,8 +2009,13 @@ hb_string_T error_human_type(ERROR_T* error) {
1329
2009
  case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: return hb_string("StrictLocalsSplatArgumentError");
1330
2010
  case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: return hb_string("StrictLocalsMissingParenthesisError");
1331
2011
  case STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR: return hb_string("StrictLocalsDuplicateDeclarationError");
2012
+ case HERB_STATE_MISSING_PARENTHESIS_ERROR: return hb_string("HerbStateMissingParenthesisError");
2013
+ case HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR: return hb_string("HerbStateNonCanonicalDirectiveError");
2014
+ case HERB_STATE_INVALID_PARAMETER_ERROR: return hb_string("HerbStateInvalidParameterError");
2015
+ case HERB_STATE_DUPLICATE_DECLARATION_ERROR: return hb_string("HerbStateDuplicateDeclarationError");
1332
2016
  case VOID_ELEMENT_CONTENT_ERROR: return hb_string("VoidElementContentError");
1333
2017
  case DOT_NOTATION_CASING_ERROR: return hb_string("DotNotationCasingError");
2018
+ case TIMEOUT_ERROR: return hb_string("TimeoutError");
1334
2019
  }
1335
2020
 
1336
2021
  return hb_string("Unknown error_type_T");
@@ -1345,9 +2030,9 @@ void error_free_base_error(ERROR_T* error, hb_allocator_T* allocator) {
1345
2030
  }
1346
2031
 
1347
2032
  static void error_free_unexpected_error(UNEXPECTED_ERROR_T* unexpected_error, hb_allocator_T* allocator) {
1348
- if (unexpected_error->description.data != NULL) { hb_allocator_dealloc(allocator, unexpected_error->description.data); }
1349
- if (unexpected_error->expected.data != NULL) { hb_allocator_dealloc(allocator, unexpected_error->expected.data); }
1350
- if (unexpected_error->found.data != NULL) { hb_allocator_dealloc(allocator, unexpected_error->found.data); }
2033
+ if (!hb_string_is_empty(unexpected_error->description)) { hb_allocator_dealloc(allocator, unexpected_error->description.data); }
2034
+ if (!hb_string_is_empty(unexpected_error->expected)) { hb_allocator_dealloc(allocator, unexpected_error->expected.data); }
2035
+ if (!hb_string_is_empty(unexpected_error->found)) { hb_allocator_dealloc(allocator, unexpected_error->found.data); }
1351
2036
 
1352
2037
  error_free_base_error(&unexpected_error->base, allocator);
1353
2038
  }
@@ -1380,8 +2065,8 @@ static void error_free_tag_names_mismatch_error(TAG_NAMES_MISMATCH_ERROR_T* tag_
1380
2065
 
1381
2066
  static void error_free_void_element_closing_tag_error(VOID_ELEMENT_CLOSING_TAG_ERROR_T* void_element_closing_tag_error, hb_allocator_T* allocator) {
1382
2067
  if (void_element_closing_tag_error->tag_name != NULL) { token_free(void_element_closing_tag_error->tag_name, allocator); }
1383
- if (void_element_closing_tag_error->expected.data != NULL) { hb_allocator_dealloc(allocator, void_element_closing_tag_error->expected.data); }
1384
- if (void_element_closing_tag_error->found.data != NULL) { hb_allocator_dealloc(allocator, void_element_closing_tag_error->found.data); }
2068
+ if (!hb_string_is_empty(void_element_closing_tag_error->expected)) { hb_allocator_dealloc(allocator, void_element_closing_tag_error->expected.data); }
2069
+ if (!hb_string_is_empty(void_element_closing_tag_error->found)) { hb_allocator_dealloc(allocator, void_element_closing_tag_error->found.data); }
1385
2070
 
1386
2071
  error_free_base_error(&void_element_closing_tag_error->base, allocator);
1387
2072
  }
@@ -1393,21 +2078,21 @@ static void error_free_unclosed_element_error(UNCLOSED_ELEMENT_ERROR_T* unclosed
1393
2078
  }
1394
2079
 
1395
2080
  static void error_free_ruby_parse_error(RUBY_PARSE_ERROR_T* ruby_parse_error, hb_allocator_T* allocator) {
1396
- if (ruby_parse_error->error_message.data != NULL) { hb_allocator_dealloc(allocator, ruby_parse_error->error_message.data); }
1397
- if (ruby_parse_error->diagnostic_id.data != NULL) { hb_allocator_dealloc(allocator, ruby_parse_error->diagnostic_id.data); }
1398
- if (ruby_parse_error->level.data != NULL) { hb_allocator_dealloc(allocator, ruby_parse_error->level.data); }
2081
+ if (!hb_string_is_empty(ruby_parse_error->error_message)) { hb_allocator_dealloc(allocator, ruby_parse_error->error_message.data); }
2082
+ if (!hb_string_is_empty(ruby_parse_error->diagnostic_id)) { hb_allocator_dealloc(allocator, ruby_parse_error->diagnostic_id.data); }
2083
+ if (!hb_string_is_empty(ruby_parse_error->level)) { hb_allocator_dealloc(allocator, ruby_parse_error->level.data); }
1399
2084
 
1400
2085
  error_free_base_error(&ruby_parse_error->base, allocator);
1401
2086
  }
1402
2087
 
1403
2088
  static void error_free_erb_control_flow_scope_error(ERB_CONTROL_FLOW_SCOPE_ERROR_T* erb_control_flow_scope_error, hb_allocator_T* allocator) {
1404
- if (erb_control_flow_scope_error->keyword.data != NULL) { hb_allocator_dealloc(allocator, erb_control_flow_scope_error->keyword.data); }
2089
+ if (!hb_string_is_empty(erb_control_flow_scope_error->keyword)) { hb_allocator_dealloc(allocator, erb_control_flow_scope_error->keyword.data); }
1405
2090
 
1406
2091
  error_free_base_error(&erb_control_flow_scope_error->base, allocator);
1407
2092
  }
1408
2093
 
1409
2094
  static void error_free_missing_erb_end_tag_error(MISSING_ERB_END_TAG_ERROR_T* missing_erb_end_tag_error, hb_allocator_T* allocator) {
1410
- if (missing_erb_end_tag_error->keyword.data != NULL) { hb_allocator_dealloc(allocator, missing_erb_end_tag_error->keyword.data); }
2095
+ if (!hb_string_is_empty(missing_erb_end_tag_error->keyword)) { hb_allocator_dealloc(allocator, missing_erb_end_tag_error->keyword.data); }
1411
2096
 
1412
2097
  error_free_base_error(&missing_erb_end_tag_error->base, allocator);
1413
2098
  }
@@ -1424,6 +2109,12 @@ static void error_free_erb_case_with_conditions_error(ERB_CASE_WITH_CONDITIONS_E
1424
2109
  error_free_base_error(&erb_case_with_conditions_error->base, allocator);
1425
2110
  }
1426
2111
 
2112
+ static void error_free_erb_case_inline_pattern_match_error(ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T* erb_case_inline_pattern_match_error, hb_allocator_T* allocator) {
2113
+ /* no ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T specific fields to free up */
2114
+
2115
+ error_free_base_error(&erb_case_inline_pattern_match_error->base, allocator);
2116
+ }
2117
+
1427
2118
  static void error_free_conditional_element_multiple_tags_error(CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T* conditional_element_multiple_tags_error, hb_allocator_T* allocator) {
1428
2119
  // size_t is part of struct
1429
2120
  // size_t is part of struct
@@ -1432,17 +2123,30 @@ static void error_free_conditional_element_multiple_tags_error(CONDITIONAL_ELEME
1432
2123
  }
1433
2124
 
1434
2125
  static void error_free_conditional_element_condition_mismatch_error(CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T* conditional_element_condition_mismatch_error, hb_allocator_T* allocator) {
1435
- if (conditional_element_condition_mismatch_error->tag_name.data != NULL) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->tag_name.data); }
1436
- if (conditional_element_condition_mismatch_error->open_condition.data != NULL) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->open_condition.data); }
2126
+ if (!hb_string_is_empty(conditional_element_condition_mismatch_error->tag_name)) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->tag_name.data); }
2127
+ if (!hb_string_is_empty(conditional_element_condition_mismatch_error->open_condition)) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->open_condition.data); }
1437
2128
  // size_t is part of struct
1438
2129
  // size_t is part of struct
1439
- if (conditional_element_condition_mismatch_error->close_condition.data != NULL) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->close_condition.data); }
2130
+ if (!hb_string_is_empty(conditional_element_condition_mismatch_error->close_condition)) { hb_allocator_dealloc(allocator, conditional_element_condition_mismatch_error->close_condition.data); }
1440
2131
  // size_t is part of struct
1441
2132
  // size_t is part of struct
1442
2133
 
1443
2134
  error_free_base_error(&conditional_element_condition_mismatch_error->base, allocator);
1444
2135
  }
1445
2136
 
2137
+ static void error_free_unclosed_comment_error(UNCLOSED_COMMENT_ERROR_T* unclosed_comment_error, hb_allocator_T* allocator) {
2138
+ if (unclosed_comment_error->comment_start != NULL) { token_free(unclosed_comment_error->comment_start, allocator); }
2139
+
2140
+ error_free_base_error(&unclosed_comment_error->base, allocator);
2141
+ }
2142
+
2143
+ static void error_free_nested_comment_error(NESTED_COMMENT_ERROR_T* nested_comment_error, hb_allocator_T* allocator) {
2144
+ if (nested_comment_error->comment_start != NULL) { token_free(nested_comment_error->comment_start, allocator); }
2145
+ if (nested_comment_error->nested_start != NULL) { token_free(nested_comment_error->nested_start, allocator); }
2146
+
2147
+ error_free_base_error(&nested_comment_error->base, allocator);
2148
+ }
2149
+
1446
2150
  static void error_free_invalid_comment_closing_tag_error(INVALID_COMMENT_CLOSING_TAG_ERROR_T* invalid_comment_closing_tag_error, hb_allocator_T* allocator) {
1447
2151
  if (invalid_comment_closing_tag_error->closing_tag != NULL) { token_free(invalid_comment_closing_tag_error->closing_tag, allocator); }
1448
2152
 
@@ -1468,6 +2172,12 @@ static void error_free_unclosed_close_tag_error(UNCLOSED_CLOSE_TAG_ERROR_T* uncl
1468
2172
  error_free_base_error(&unclosed_close_tag_error->base, allocator);
1469
2173
  }
1470
2174
 
2175
+ static void error_free_end_tag_with_trailing_solidus_error(END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T* end_tag_with_trailing_solidus_error, hb_allocator_T* allocator) {
2176
+ if (end_tag_with_trailing_solidus_error->tag_name != NULL) { token_free(end_tag_with_trailing_solidus_error->tag_name, allocator); }
2177
+
2178
+ error_free_base_error(&end_tag_with_trailing_solidus_error->base, allocator);
2179
+ }
2180
+
1471
2181
  static void error_free_unclosed_quote_error(UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error, hb_allocator_T* allocator) {
1472
2182
  if (unclosed_quote_error->opening_quote != NULL) { token_free(unclosed_quote_error->opening_quote, allocator); }
1473
2183
 
@@ -1475,17 +2185,54 @@ static void error_free_unclosed_quote_error(UNCLOSED_QUOTE_ERROR_T* unclosed_quo
1475
2185
  }
1476
2186
 
1477
2187
  static void error_free_missing_attribute_value_error(MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error, hb_allocator_T* allocator) {
1478
- if (missing_attribute_value_error->attribute_name.data != NULL) { hb_allocator_dealloc(allocator, missing_attribute_value_error->attribute_name.data); }
2188
+ if (!hb_string_is_empty(missing_attribute_value_error->attribute_name)) { hb_allocator_dealloc(allocator, missing_attribute_value_error->attribute_name.data); }
1479
2189
 
1480
2190
  error_free_base_error(&missing_attribute_value_error->base, allocator);
1481
2191
  }
1482
2192
 
2193
+ static void error_free_missing_whitespace_between_attributes_error(MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T* missing_whitespace_between_attributes_error, hb_allocator_T* allocator) {
2194
+ if (missing_whitespace_between_attributes_error->found != NULL) { token_free(missing_whitespace_between_attributes_error->found, allocator); }
2195
+
2196
+ error_free_base_error(&missing_whitespace_between_attributes_error->base, allocator);
2197
+ }
2198
+
2199
+ static void error_free_unexpected_character_in_attribute_name_error(UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T* unexpected_character_in_attribute_name_error, hb_allocator_T* allocator) {
2200
+ if (unexpected_character_in_attribute_name_error->character != NULL) { token_free(unexpected_character_in_attribute_name_error->character, allocator); }
2201
+
2202
+ error_free_base_error(&unexpected_character_in_attribute_name_error->base, allocator);
2203
+ }
2204
+
2205
+ static void error_free_unexpected_character_in_unquoted_attribute_value_error(UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T* unexpected_character_in_unquoted_attribute_value_error, hb_allocator_T* allocator) {
2206
+ if (unexpected_character_in_unquoted_attribute_value_error->character != NULL) { token_free(unexpected_character_in_unquoted_attribute_value_error->character, allocator); }
2207
+
2208
+ error_free_base_error(&unexpected_character_in_unquoted_attribute_value_error->base, allocator);
2209
+ }
2210
+
2211
+ static void error_free_unexpected_equals_sign_before_attribute_name_error(UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T* unexpected_equals_sign_before_attribute_name_error, hb_allocator_T* allocator) {
2212
+ if (unexpected_equals_sign_before_attribute_name_error->equals != NULL) { token_free(unexpected_equals_sign_before_attribute_name_error->equals, allocator); }
2213
+
2214
+ error_free_base_error(&unexpected_equals_sign_before_attribute_name_error->base, allocator);
2215
+ }
2216
+
2217
+ static void error_free_unexpected_solidus_in_tag_error(UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T* unexpected_solidus_in_tag_error, hb_allocator_T* allocator) {
2218
+ if (unexpected_solidus_in_tag_error->solidus != NULL) { token_free(unexpected_solidus_in_tag_error->solidus, allocator); }
2219
+
2220
+ error_free_base_error(&unexpected_solidus_in_tag_error->base, allocator);
2221
+ }
2222
+
1483
2223
  static void error_free_unclosed_erb_tag_error(UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error, hb_allocator_T* allocator) {
1484
2224
  if (unclosed_erb_tag_error->opening_tag != NULL) { token_free(unclosed_erb_tag_error->opening_tag, allocator); }
1485
2225
 
1486
2226
  error_free_base_error(&unclosed_erb_tag_error->base, allocator);
1487
2227
  }
1488
2228
 
2229
+ static void error_free_malformed_erb_closing_tag_error(MALFORMED_ERB_CLOSING_TAG_ERROR_T* malformed_erb_closing_tag_error, hb_allocator_T* allocator) {
2230
+ if (malformed_erb_closing_tag_error->opening_tag != NULL) { token_free(malformed_erb_closing_tag_error->opening_tag, allocator); }
2231
+ if (malformed_erb_closing_tag_error->closing_tag != NULL) { token_free(malformed_erb_closing_tag_error->closing_tag, allocator); }
2232
+
2233
+ error_free_base_error(&malformed_erb_closing_tag_error->base, allocator);
2234
+ }
2235
+
1489
2236
  static void error_free_stray_erb_closing_tag_error(STRAY_ERB_CLOSING_TAG_ERROR_T* stray_erb_closing_tag_error, hb_allocator_T* allocator) {
1490
2237
  /* no STRAY_ERB_CLOSING_TAG_ERROR_T specific fields to free up */
1491
2238
 
@@ -1501,14 +2248,14 @@ static void error_free_nested_erb_tag_error(NESTED_ERB_TAG_ERROR_T* nested_erb_t
1501
2248
  }
1502
2249
 
1503
2250
  static void error_free_render_ambiguous_locals_error(RENDER_AMBIGUOUS_LOCALS_ERROR_T* render_ambiguous_locals_error, hb_allocator_T* allocator) {
1504
- if (render_ambiguous_locals_error->partial.data != NULL) { hb_allocator_dealloc(allocator, render_ambiguous_locals_error->partial.data); }
2251
+ if (!hb_string_is_empty(render_ambiguous_locals_error->partial)) { hb_allocator_dealloc(allocator, render_ambiguous_locals_error->partial.data); }
1505
2252
 
1506
2253
  error_free_base_error(&render_ambiguous_locals_error->base, allocator);
1507
2254
  }
1508
2255
 
1509
2256
  static void error_free_render_missing_locals_error(RENDER_MISSING_LOCALS_ERROR_T* render_missing_locals_error, hb_allocator_T* allocator) {
1510
- if (render_missing_locals_error->partial.data != NULL) { hb_allocator_dealloc(allocator, render_missing_locals_error->partial.data); }
1511
- if (render_missing_locals_error->keywords.data != NULL) { hb_allocator_dealloc(allocator, render_missing_locals_error->keywords.data); }
2257
+ if (!hb_string_is_empty(render_missing_locals_error->partial)) { hb_allocator_dealloc(allocator, render_missing_locals_error->partial.data); }
2258
+ if (!hb_string_is_empty(render_missing_locals_error->keywords)) { hb_allocator_dealloc(allocator, render_missing_locals_error->keywords.data); }
1512
2259
 
1513
2260
  error_free_base_error(&render_missing_locals_error->base, allocator);
1514
2261
  }
@@ -1520,14 +2267,14 @@ static void error_free_render_no_arguments_error(RENDER_NO_ARGUMENTS_ERROR_T* re
1520
2267
  }
1521
2268
 
1522
2269
  static void error_free_render_conflicting_partial_error(RENDER_CONFLICTING_PARTIAL_ERROR_T* render_conflicting_partial_error, hb_allocator_T* allocator) {
1523
- if (render_conflicting_partial_error->positional_partial.data != NULL) { hb_allocator_dealloc(allocator, render_conflicting_partial_error->positional_partial.data); }
1524
- if (render_conflicting_partial_error->keyword_partial.data != NULL) { hb_allocator_dealloc(allocator, render_conflicting_partial_error->keyword_partial.data); }
2270
+ if (!hb_string_is_empty(render_conflicting_partial_error->positional_partial)) { hb_allocator_dealloc(allocator, render_conflicting_partial_error->positional_partial.data); }
2271
+ if (!hb_string_is_empty(render_conflicting_partial_error->keyword_partial)) { hb_allocator_dealloc(allocator, render_conflicting_partial_error->keyword_partial.data); }
1525
2272
 
1526
2273
  error_free_base_error(&render_conflicting_partial_error->base, allocator);
1527
2274
  }
1528
2275
 
1529
2276
  static void error_free_render_invalid_as_option_error(RENDER_INVALID_AS_OPTION_ERROR_T* render_invalid_as_option_error, hb_allocator_T* allocator) {
1530
- if (render_invalid_as_option_error->as_value.data != NULL) { hb_allocator_dealloc(allocator, render_invalid_as_option_error->as_value.data); }
2277
+ if (!hb_string_is_empty(render_invalid_as_option_error->as_value)) { hb_allocator_dealloc(allocator, render_invalid_as_option_error->as_value.data); }
1531
2278
 
1532
2279
  error_free_base_error(&render_invalid_as_option_error->base, allocator);
1533
2280
  }
@@ -1539,31 +2286,31 @@ static void error_free_render_object_and_collection_error(RENDER_OBJECT_AND_COLL
1539
2286
  }
1540
2287
 
1541
2288
  static void error_free_render_layout_without_block_error(RENDER_LAYOUT_WITHOUT_BLOCK_ERROR_T* render_layout_without_block_error, hb_allocator_T* allocator) {
1542
- if (render_layout_without_block_error->layout.data != NULL) { hb_allocator_dealloc(allocator, render_layout_without_block_error->layout.data); }
2289
+ if (!hb_string_is_empty(render_layout_without_block_error->layout)) { hb_allocator_dealloc(allocator, render_layout_without_block_error->layout.data); }
1543
2290
 
1544
2291
  error_free_base_error(&render_layout_without_block_error->base, allocator);
1545
2292
  }
1546
2293
 
1547
2294
  static void error_free_strict_locals_positional_argument_error(STRICT_LOCALS_POSITIONAL_ARGUMENT_ERROR_T* strict_locals_positional_argument_error, hb_allocator_T* allocator) {
1548
- if (strict_locals_positional_argument_error->name.data != NULL) { hb_allocator_dealloc(allocator, strict_locals_positional_argument_error->name.data); }
2295
+ if (!hb_string_is_empty(strict_locals_positional_argument_error->name)) { hb_allocator_dealloc(allocator, strict_locals_positional_argument_error->name.data); }
1549
2296
 
1550
2297
  error_free_base_error(&strict_locals_positional_argument_error->base, allocator);
1551
2298
  }
1552
2299
 
1553
2300
  static void error_free_strict_locals_block_argument_error(STRICT_LOCALS_BLOCK_ARGUMENT_ERROR_T* strict_locals_block_argument_error, hb_allocator_T* allocator) {
1554
- if (strict_locals_block_argument_error->name.data != NULL) { hb_allocator_dealloc(allocator, strict_locals_block_argument_error->name.data); }
2301
+ if (!hb_string_is_empty(strict_locals_block_argument_error->name)) { hb_allocator_dealloc(allocator, strict_locals_block_argument_error->name.data); }
1555
2302
 
1556
2303
  error_free_base_error(&strict_locals_block_argument_error->base, allocator);
1557
2304
  }
1558
2305
 
1559
2306
  static void error_free_strict_locals_splat_argument_error(STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T* strict_locals_splat_argument_error, hb_allocator_T* allocator) {
1560
- if (strict_locals_splat_argument_error->name.data != NULL) { hb_allocator_dealloc(allocator, strict_locals_splat_argument_error->name.data); }
2307
+ if (!hb_string_is_empty(strict_locals_splat_argument_error->name)) { hb_allocator_dealloc(allocator, strict_locals_splat_argument_error->name.data); }
1561
2308
 
1562
2309
  error_free_base_error(&strict_locals_splat_argument_error->base, allocator);
1563
2310
  }
1564
2311
 
1565
2312
  static void error_free_strict_locals_missing_parenthesis_error(STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_error, hb_allocator_T* allocator) {
1566
- if (strict_locals_missing_parenthesis_error->rest.data != NULL) { hb_allocator_dealloc(allocator, strict_locals_missing_parenthesis_error->rest.data); }
2313
+ if (!hb_string_is_empty(strict_locals_missing_parenthesis_error->rest)) { hb_allocator_dealloc(allocator, strict_locals_missing_parenthesis_error->rest.data); }
1567
2314
 
1568
2315
  error_free_base_error(&strict_locals_missing_parenthesis_error->base, allocator);
1569
2316
  }
@@ -1574,10 +2321,35 @@ static void error_free_strict_locals_duplicate_declaration_error(STRICT_LOCALS_D
1574
2321
  error_free_base_error(&strict_locals_duplicate_declaration_error->base, allocator);
1575
2322
  }
1576
2323
 
2324
+ static void error_free_herb_state_missing_parenthesis_error(HERB_STATE_MISSING_PARENTHESIS_ERROR_T* herb_state_missing_parenthesis_error, hb_allocator_T* allocator) {
2325
+ if (!hb_string_is_empty(herb_state_missing_parenthesis_error->rest)) { hb_allocator_dealloc(allocator, herb_state_missing_parenthesis_error->rest.data); }
2326
+
2327
+ error_free_base_error(&herb_state_missing_parenthesis_error->base, allocator);
2328
+ }
2329
+
2330
+ static void error_free_herb_state_non_canonical_directive_error(HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T* herb_state_non_canonical_directive_error, hb_allocator_T* allocator) {
2331
+ if (!hb_string_is_empty(herb_state_non_canonical_directive_error->found)) { hb_allocator_dealloc(allocator, herb_state_non_canonical_directive_error->found.data); }
2332
+ if (!hb_string_is_empty(herb_state_non_canonical_directive_error->expected)) { hb_allocator_dealloc(allocator, herb_state_non_canonical_directive_error->expected.data); }
2333
+
2334
+ error_free_base_error(&herb_state_non_canonical_directive_error->base, allocator);
2335
+ }
2336
+
2337
+ static void error_free_herb_state_invalid_parameter_error(HERB_STATE_INVALID_PARAMETER_ERROR_T* herb_state_invalid_parameter_error, hb_allocator_T* allocator) {
2338
+ if (!hb_string_is_empty(herb_state_invalid_parameter_error->parameter)) { hb_allocator_dealloc(allocator, herb_state_invalid_parameter_error->parameter.data); }
2339
+
2340
+ error_free_base_error(&herb_state_invalid_parameter_error->base, allocator);
2341
+ }
2342
+
2343
+ static void error_free_herb_state_duplicate_declaration_error(HERB_STATE_DUPLICATE_DECLARATION_ERROR_T* herb_state_duplicate_declaration_error, hb_allocator_T* allocator) {
2344
+ /* no HERB_STATE_DUPLICATE_DECLARATION_ERROR_T specific fields to free up */
2345
+
2346
+ error_free_base_error(&herb_state_duplicate_declaration_error->base, allocator);
2347
+ }
2348
+
1577
2349
  static void error_free_void_element_content_error(VOID_ELEMENT_CONTENT_ERROR_T* void_element_content_error, hb_allocator_T* allocator) {
1578
2350
  if (void_element_content_error->tag_name != NULL) { token_free(void_element_content_error->tag_name, allocator); }
1579
- if (void_element_content_error->helper_name.data != NULL) { hb_allocator_dealloc(allocator, void_element_content_error->helper_name.data); }
1580
- if (void_element_content_error->content_type.data != NULL) { hb_allocator_dealloc(allocator, void_element_content_error->content_type.data); }
2351
+ if (!hb_string_is_empty(void_element_content_error->helper_name)) { hb_allocator_dealloc(allocator, void_element_content_error->helper_name.data); }
2352
+ if (!hb_string_is_empty(void_element_content_error->content_type)) { hb_allocator_dealloc(allocator, void_element_content_error->content_type.data); }
1581
2353
 
1582
2354
  error_free_base_error(&void_element_content_error->base, allocator);
1583
2355
  }
@@ -1588,6 +2360,12 @@ static void error_free_dot_notation_casing_error(DOT_NOTATION_CASING_ERROR_T* do
1588
2360
  error_free_base_error(&dot_notation_casing_error->base, allocator);
1589
2361
  }
1590
2362
 
2363
+ static void error_free_timeout_error(TIMEOUT_ERROR_T* timeout_error, hb_allocator_T* allocator) {
2364
+ // size_t is part of struct
2365
+
2366
+ error_free_base_error(&timeout_error->base, allocator);
2367
+ }
2368
+
1591
2369
  void error_free(ERROR_T* error, hb_allocator_T* allocator) {
1592
2370
  if (!error) { return; }
1593
2371
 
@@ -1604,15 +2382,25 @@ void error_free(ERROR_T* error, hb_allocator_T* allocator) {
1604
2382
  case MISSING_ERB_END_TAG_ERROR: error_free_missing_erb_end_tag_error((MISSING_ERB_END_TAG_ERROR_T*) error, allocator); break;
1605
2383
  case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: error_free_erb_multiple_blocks_in_tag_error((ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T*) error, allocator); break;
1606
2384
  case ERB_CASE_WITH_CONDITIONS_ERROR: error_free_erb_case_with_conditions_error((ERB_CASE_WITH_CONDITIONS_ERROR_T*) error, allocator); break;
2385
+ case ERB_CASE_INLINE_PATTERN_MATCH_ERROR: error_free_erb_case_inline_pattern_match_error((ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T*) error, allocator); break;
1607
2386
  case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: error_free_conditional_element_multiple_tags_error((CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T*) error, allocator); break;
1608
2387
  case CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR: error_free_conditional_element_condition_mismatch_error((CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T*) error, allocator); break;
2388
+ case UNCLOSED_COMMENT_ERROR: error_free_unclosed_comment_error((UNCLOSED_COMMENT_ERROR_T*) error, allocator); break;
2389
+ case NESTED_COMMENT_ERROR: error_free_nested_comment_error((NESTED_COMMENT_ERROR_T*) error, allocator); break;
1609
2390
  case INVALID_COMMENT_CLOSING_TAG_ERROR: error_free_invalid_comment_closing_tag_error((INVALID_COMMENT_CLOSING_TAG_ERROR_T*) error, allocator); break;
1610
2391
  case OMITTED_CLOSING_TAG_ERROR: error_free_omitted_closing_tag_error((OMITTED_CLOSING_TAG_ERROR_T*) error, allocator); break;
1611
2392
  case UNCLOSED_OPEN_TAG_ERROR: error_free_unclosed_open_tag_error((UNCLOSED_OPEN_TAG_ERROR_T*) error, allocator); break;
1612
2393
  case UNCLOSED_CLOSE_TAG_ERROR: error_free_unclosed_close_tag_error((UNCLOSED_CLOSE_TAG_ERROR_T*) error, allocator); break;
2394
+ case END_TAG_WITH_TRAILING_SOLIDUS_ERROR: error_free_end_tag_with_trailing_solidus_error((END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T*) error, allocator); break;
1613
2395
  case UNCLOSED_QUOTE_ERROR: error_free_unclosed_quote_error((UNCLOSED_QUOTE_ERROR_T*) error, allocator); break;
1614
2396
  case MISSING_ATTRIBUTE_VALUE_ERROR: error_free_missing_attribute_value_error((MISSING_ATTRIBUTE_VALUE_ERROR_T*) error, allocator); break;
2397
+ case MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR: error_free_missing_whitespace_between_attributes_error((MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T*) error, allocator); break;
2398
+ case UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR: error_free_unexpected_character_in_attribute_name_error((UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T*) error, allocator); break;
2399
+ case UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR: error_free_unexpected_character_in_unquoted_attribute_value_error((UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T*) error, allocator); break;
2400
+ case UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR: error_free_unexpected_equals_sign_before_attribute_name_error((UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T*) error, allocator); break;
2401
+ case UNEXPECTED_SOLIDUS_IN_TAG_ERROR: error_free_unexpected_solidus_in_tag_error((UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T*) error, allocator); break;
1615
2402
  case UNCLOSED_ERB_TAG_ERROR: error_free_unclosed_erb_tag_error((UNCLOSED_ERB_TAG_ERROR_T*) error, allocator); break;
2403
+ case MALFORMED_ERB_CLOSING_TAG_ERROR: error_free_malformed_erb_closing_tag_error((MALFORMED_ERB_CLOSING_TAG_ERROR_T*) error, allocator); break;
1616
2404
  case STRAY_ERB_CLOSING_TAG_ERROR: error_free_stray_erb_closing_tag_error((STRAY_ERB_CLOSING_TAG_ERROR_T*) error, allocator); break;
1617
2405
  case NESTED_ERB_TAG_ERROR: error_free_nested_erb_tag_error((NESTED_ERB_TAG_ERROR_T*) error, allocator); break;
1618
2406
  case RENDER_AMBIGUOUS_LOCALS_ERROR: error_free_render_ambiguous_locals_error((RENDER_AMBIGUOUS_LOCALS_ERROR_T*) error, allocator); break;
@@ -1627,8 +2415,13 @@ void error_free(ERROR_T* error, hb_allocator_T* allocator) {
1627
2415
  case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: error_free_strict_locals_splat_argument_error((STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T*) error, allocator); break;
1628
2416
  case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: error_free_strict_locals_missing_parenthesis_error((STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T*) error, allocator); break;
1629
2417
  case STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR: error_free_strict_locals_duplicate_declaration_error((STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T*) error, allocator); break;
2418
+ case HERB_STATE_MISSING_PARENTHESIS_ERROR: error_free_herb_state_missing_parenthesis_error((HERB_STATE_MISSING_PARENTHESIS_ERROR_T*) error, allocator); break;
2419
+ case HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR: error_free_herb_state_non_canonical_directive_error((HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T*) error, allocator); break;
2420
+ case HERB_STATE_INVALID_PARAMETER_ERROR: error_free_herb_state_invalid_parameter_error((HERB_STATE_INVALID_PARAMETER_ERROR_T*) error, allocator); break;
2421
+ case HERB_STATE_DUPLICATE_DECLARATION_ERROR: error_free_herb_state_duplicate_declaration_error((HERB_STATE_DUPLICATE_DECLARATION_ERROR_T*) error, allocator); break;
1630
2422
  case VOID_ELEMENT_CONTENT_ERROR: error_free_void_element_content_error((VOID_ELEMENT_CONTENT_ERROR_T*) error, allocator); break;
1631
2423
  case DOT_NOTATION_CASING_ERROR: error_free_dot_notation_casing_error((DOT_NOTATION_CASING_ERROR_T*) error, allocator); break;
2424
+ case TIMEOUT_ERROR: error_free_timeout_error((TIMEOUT_ERROR_T*) error, allocator); break;
1632
2425
  }
1633
2426
  }
1634
2427
 
@@ -1852,6 +2645,19 @@ static void error_pretty_print_erb_case_with_conditions_error(ERB_CASE_WITH_COND
1852
2645
  pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
1853
2646
  }
1854
2647
 
2648
+ static void error_pretty_print_erb_case_inline_pattern_match_error(ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2649
+ if (!error) { return; }
2650
+
2651
+ hb_buffer_append(buffer, "@ ");
2652
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2653
+ hb_buffer_append(buffer, " ");
2654
+
2655
+ pretty_print_location(error->base.location, buffer);
2656
+ hb_buffer_append(buffer, "\n");
2657
+
2658
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
2659
+ }
2660
+
1855
2661
  static void error_pretty_print_conditional_element_multiple_tags_error(CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
1856
2662
  if (!error) { return; }
1857
2663
 
@@ -1887,6 +2693,35 @@ static void error_pretty_print_conditional_element_condition_mismatch_error(COND
1887
2693
  pretty_print_size_t_property(error->close_column, hb_string("close_column"), indent, relative_indent, true, buffer);
1888
2694
  }
1889
2695
 
2696
+ static void error_pretty_print_unclosed_comment_error(UNCLOSED_COMMENT_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2697
+ if (!error) { return; }
2698
+
2699
+ hb_buffer_append(buffer, "@ ");
2700
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2701
+ hb_buffer_append(buffer, " ");
2702
+
2703
+ pretty_print_location(error->base.location, buffer);
2704
+ hb_buffer_append(buffer, "\n");
2705
+
2706
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2707
+ pretty_print_token_property(error->comment_start, hb_string("comment_start"), indent, relative_indent, true, buffer);
2708
+ }
2709
+
2710
+ static void error_pretty_print_nested_comment_error(NESTED_COMMENT_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2711
+ if (!error) { return; }
2712
+
2713
+ hb_buffer_append(buffer, "@ ");
2714
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2715
+ hb_buffer_append(buffer, " ");
2716
+
2717
+ pretty_print_location(error->base.location, buffer);
2718
+ hb_buffer_append(buffer, "\n");
2719
+
2720
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2721
+ pretty_print_token_property(error->comment_start, hb_string("comment_start"), indent, relative_indent, false, buffer);
2722
+ pretty_print_token_property(error->nested_start, hb_string("nested_start"), indent, relative_indent, true, buffer);
2723
+ }
2724
+
1890
2725
  static void error_pretty_print_invalid_comment_closing_tag_error(INVALID_COMMENT_CLOSING_TAG_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
1891
2726
  if (!error) { return; }
1892
2727
 
@@ -1944,6 +2779,20 @@ static void error_pretty_print_unclosed_close_tag_error(UNCLOSED_CLOSE_TAG_ERROR
1944
2779
  pretty_print_token_property(error->tag_name, hb_string("tag_name"), indent, relative_indent, true, buffer);
1945
2780
  }
1946
2781
 
2782
+ static void error_pretty_print_end_tag_with_trailing_solidus_error(END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2783
+ if (!error) { return; }
2784
+
2785
+ hb_buffer_append(buffer, "@ ");
2786
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2787
+ hb_buffer_append(buffer, " ");
2788
+
2789
+ pretty_print_location(error->base.location, buffer);
2790
+ hb_buffer_append(buffer, "\n");
2791
+
2792
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2793
+ pretty_print_token_property(error->tag_name, hb_string("tag_name"), indent, relative_indent, true, buffer);
2794
+ }
2795
+
1947
2796
  static void error_pretty_print_unclosed_quote_error(UNCLOSED_QUOTE_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
1948
2797
  if (!error) { return; }
1949
2798
 
@@ -1972,6 +2821,76 @@ static void error_pretty_print_missing_attribute_value_error(MISSING_ATTRIBUTE_V
1972
2821
  pretty_print_quoted_property(hb_string("attribute_name"), error->attribute_name, indent, relative_indent, true, buffer);
1973
2822
  }
1974
2823
 
2824
+ static void error_pretty_print_missing_whitespace_between_attributes_error(MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2825
+ if (!error) { return; }
2826
+
2827
+ hb_buffer_append(buffer, "@ ");
2828
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2829
+ hb_buffer_append(buffer, " ");
2830
+
2831
+ pretty_print_location(error->base.location, buffer);
2832
+ hb_buffer_append(buffer, "\n");
2833
+
2834
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2835
+ pretty_print_token_property(error->found, hb_string("found"), indent, relative_indent, true, buffer);
2836
+ }
2837
+
2838
+ static void error_pretty_print_unexpected_character_in_attribute_name_error(UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2839
+ if (!error) { return; }
2840
+
2841
+ hb_buffer_append(buffer, "@ ");
2842
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2843
+ hb_buffer_append(buffer, " ");
2844
+
2845
+ pretty_print_location(error->base.location, buffer);
2846
+ hb_buffer_append(buffer, "\n");
2847
+
2848
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2849
+ pretty_print_token_property(error->character, hb_string("character"), indent, relative_indent, true, buffer);
2850
+ }
2851
+
2852
+ static void error_pretty_print_unexpected_character_in_unquoted_attribute_value_error(UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2853
+ if (!error) { return; }
2854
+
2855
+ hb_buffer_append(buffer, "@ ");
2856
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2857
+ hb_buffer_append(buffer, " ");
2858
+
2859
+ pretty_print_location(error->base.location, buffer);
2860
+ hb_buffer_append(buffer, "\n");
2861
+
2862
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2863
+ pretty_print_token_property(error->character, hb_string("character"), indent, relative_indent, true, buffer);
2864
+ }
2865
+
2866
+ static void error_pretty_print_unexpected_equals_sign_before_attribute_name_error(UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2867
+ if (!error) { return; }
2868
+
2869
+ hb_buffer_append(buffer, "@ ");
2870
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2871
+ hb_buffer_append(buffer, " ");
2872
+
2873
+ pretty_print_location(error->base.location, buffer);
2874
+ hb_buffer_append(buffer, "\n");
2875
+
2876
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2877
+ pretty_print_token_property(error->equals, hb_string("equals"), indent, relative_indent, true, buffer);
2878
+ }
2879
+
2880
+ static void error_pretty_print_unexpected_solidus_in_tag_error(UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2881
+ if (!error) { return; }
2882
+
2883
+ hb_buffer_append(buffer, "@ ");
2884
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2885
+ hb_buffer_append(buffer, " ");
2886
+
2887
+ pretty_print_location(error->base.location, buffer);
2888
+ hb_buffer_append(buffer, "\n");
2889
+
2890
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2891
+ pretty_print_token_property(error->solidus, hb_string("solidus"), indent, relative_indent, true, buffer);
2892
+ }
2893
+
1975
2894
  static void error_pretty_print_unclosed_erb_tag_error(UNCLOSED_ERB_TAG_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
1976
2895
  if (!error) { return; }
1977
2896
 
@@ -1986,6 +2905,21 @@ static void error_pretty_print_unclosed_erb_tag_error(UNCLOSED_ERB_TAG_ERROR_T*
1986
2905
  pretty_print_token_property(error->opening_tag, hb_string("opening_tag"), indent, relative_indent, true, buffer);
1987
2906
  }
1988
2907
 
2908
+ static void error_pretty_print_malformed_erb_closing_tag_error(MALFORMED_ERB_CLOSING_TAG_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2909
+ if (!error) { return; }
2910
+
2911
+ hb_buffer_append(buffer, "@ ");
2912
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
2913
+ hb_buffer_append(buffer, " ");
2914
+
2915
+ pretty_print_location(error->base.location, buffer);
2916
+ hb_buffer_append(buffer, "\n");
2917
+
2918
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
2919
+ pretty_print_token_property(error->opening_tag, hb_string("opening_tag"), indent, relative_indent, false, buffer);
2920
+ pretty_print_token_property(error->closing_tag, hb_string("closing_tag"), indent, relative_indent, true, buffer);
2921
+ }
2922
+
1989
2923
  static void error_pretty_print_stray_erb_closing_tag_error(STRAY_ERB_CLOSING_TAG_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
1990
2924
  if (!error) { return; }
1991
2925
 
@@ -2182,6 +3116,62 @@ static void error_pretty_print_strict_locals_duplicate_declaration_error(STRICT_
2182
3116
  pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
2183
3117
  }
2184
3118
 
3119
+ static void error_pretty_print_herb_state_missing_parenthesis_error(HERB_STATE_MISSING_PARENTHESIS_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
3120
+ if (!error) { return; }
3121
+
3122
+ hb_buffer_append(buffer, "@ ");
3123
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
3124
+ hb_buffer_append(buffer, " ");
3125
+
3126
+ pretty_print_location(error->base.location, buffer);
3127
+ hb_buffer_append(buffer, "\n");
3128
+
3129
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
3130
+ pretty_print_quoted_property(hb_string("rest"), error->rest, indent, relative_indent, true, buffer);
3131
+ }
3132
+
3133
+ static void error_pretty_print_herb_state_non_canonical_directive_error(HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
3134
+ if (!error) { return; }
3135
+
3136
+ hb_buffer_append(buffer, "@ ");
3137
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
3138
+ hb_buffer_append(buffer, " ");
3139
+
3140
+ pretty_print_location(error->base.location, buffer);
3141
+ hb_buffer_append(buffer, "\n");
3142
+
3143
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
3144
+ pretty_print_quoted_property(hb_string("found"), error->found, indent, relative_indent, false, buffer);
3145
+ pretty_print_quoted_property(hb_string("expected"), error->expected, indent, relative_indent, true, buffer);
3146
+ }
3147
+
3148
+ static void error_pretty_print_herb_state_invalid_parameter_error(HERB_STATE_INVALID_PARAMETER_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
3149
+ if (!error) { return; }
3150
+
3151
+ hb_buffer_append(buffer, "@ ");
3152
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
3153
+ hb_buffer_append(buffer, " ");
3154
+
3155
+ pretty_print_location(error->base.location, buffer);
3156
+ hb_buffer_append(buffer, "\n");
3157
+
3158
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
3159
+ pretty_print_quoted_property(hb_string("parameter"), error->parameter, indent, relative_indent, true, buffer);
3160
+ }
3161
+
3162
+ static void error_pretty_print_herb_state_duplicate_declaration_error(HERB_STATE_DUPLICATE_DECLARATION_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
3163
+ if (!error) { return; }
3164
+
3165
+ hb_buffer_append(buffer, "@ ");
3166
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
3167
+ hb_buffer_append(buffer, " ");
3168
+
3169
+ pretty_print_location(error->base.location, buffer);
3170
+ hb_buffer_append(buffer, "\n");
3171
+
3172
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
3173
+ }
3174
+
2185
3175
  static void error_pretty_print_void_element_content_error(VOID_ELEMENT_CONTENT_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2186
3176
  if (!error) { return; }
2187
3177
 
@@ -2212,6 +3202,20 @@ static void error_pretty_print_dot_notation_casing_error(DOT_NOTATION_CASING_ERR
2212
3202
  pretty_print_token_property(error->segment, hb_string("segment"), indent, relative_indent, true, buffer);
2213
3203
  }
2214
3204
 
3205
+ static void error_pretty_print_timeout_error(TIMEOUT_ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
3206
+ if (!error) { return; }
3207
+
3208
+ hb_buffer_append(buffer, "@ ");
3209
+ hb_buffer_append_string(buffer, error_human_type((ERROR_T*) error));
3210
+ hb_buffer_append(buffer, " ");
3211
+
3212
+ pretty_print_location(error->base.location, buffer);
3213
+ hb_buffer_append(buffer, "\n");
3214
+
3215
+ pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, false, buffer);
3216
+ pretty_print_size_t_property(error->timeout_ms, hb_string("timeout_ms"), indent, relative_indent, true, buffer);
3217
+ }
3218
+
2215
3219
  void error_pretty_print(ERROR_T* error, const size_t indent, const size_t relative_indent, hb_buffer_T* buffer) {
2216
3220
  if (!error) { return; }
2217
3221
 
@@ -2228,15 +3232,25 @@ void error_pretty_print(ERROR_T* error, const size_t indent, const size_t relati
2228
3232
  case MISSING_ERB_END_TAG_ERROR: error_pretty_print_missing_erb_end_tag_error((MISSING_ERB_END_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2229
3233
  case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: error_pretty_print_erb_multiple_blocks_in_tag_error((ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2230
3234
  case ERB_CASE_WITH_CONDITIONS_ERROR: error_pretty_print_erb_case_with_conditions_error((ERB_CASE_WITH_CONDITIONS_ERROR_T*) error, indent, relative_indent, buffer); break;
3235
+ case ERB_CASE_INLINE_PATTERN_MATCH_ERROR: error_pretty_print_erb_case_inline_pattern_match_error((ERB_CASE_INLINE_PATTERN_MATCH_ERROR_T*) error, indent, relative_indent, buffer); break;
2231
3236
  case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: error_pretty_print_conditional_element_multiple_tags_error((CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T*) error, indent, relative_indent, buffer); break;
2232
3237
  case CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR: error_pretty_print_conditional_element_condition_mismatch_error((CONDITIONAL_ELEMENT_CONDITION_MISMATCH_ERROR_T*) error, indent, relative_indent, buffer); break;
3238
+ case UNCLOSED_COMMENT_ERROR: error_pretty_print_unclosed_comment_error((UNCLOSED_COMMENT_ERROR_T*) error, indent, relative_indent, buffer); break;
3239
+ case NESTED_COMMENT_ERROR: error_pretty_print_nested_comment_error((NESTED_COMMENT_ERROR_T*) error, indent, relative_indent, buffer); break;
2233
3240
  case INVALID_COMMENT_CLOSING_TAG_ERROR: error_pretty_print_invalid_comment_closing_tag_error((INVALID_COMMENT_CLOSING_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2234
3241
  case OMITTED_CLOSING_TAG_ERROR: error_pretty_print_omitted_closing_tag_error((OMITTED_CLOSING_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2235
3242
  case UNCLOSED_OPEN_TAG_ERROR: error_pretty_print_unclosed_open_tag_error((UNCLOSED_OPEN_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2236
3243
  case UNCLOSED_CLOSE_TAG_ERROR: error_pretty_print_unclosed_close_tag_error((UNCLOSED_CLOSE_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
3244
+ case END_TAG_WITH_TRAILING_SOLIDUS_ERROR: error_pretty_print_end_tag_with_trailing_solidus_error((END_TAG_WITH_TRAILING_SOLIDUS_ERROR_T*) error, indent, relative_indent, buffer); break;
2237
3245
  case UNCLOSED_QUOTE_ERROR: error_pretty_print_unclosed_quote_error((UNCLOSED_QUOTE_ERROR_T*) error, indent, relative_indent, buffer); break;
2238
3246
  case MISSING_ATTRIBUTE_VALUE_ERROR: error_pretty_print_missing_attribute_value_error((MISSING_ATTRIBUTE_VALUE_ERROR_T*) error, indent, relative_indent, buffer); break;
3247
+ case MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR: error_pretty_print_missing_whitespace_between_attributes_error((MISSING_WHITESPACE_BETWEEN_ATTRIBUTES_ERROR_T*) error, indent, relative_indent, buffer); break;
3248
+ case UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR: error_pretty_print_unexpected_character_in_attribute_name_error((UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME_ERROR_T*) error, indent, relative_indent, buffer); break;
3249
+ case UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR: error_pretty_print_unexpected_character_in_unquoted_attribute_value_error((UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE_ERROR_T*) error, indent, relative_indent, buffer); break;
3250
+ case UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR: error_pretty_print_unexpected_equals_sign_before_attribute_name_error((UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME_ERROR_T*) error, indent, relative_indent, buffer); break;
3251
+ case UNEXPECTED_SOLIDUS_IN_TAG_ERROR: error_pretty_print_unexpected_solidus_in_tag_error((UNEXPECTED_SOLIDUS_IN_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2239
3252
  case UNCLOSED_ERB_TAG_ERROR: error_pretty_print_unclosed_erb_tag_error((UNCLOSED_ERB_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
3253
+ case MALFORMED_ERB_CLOSING_TAG_ERROR: error_pretty_print_malformed_erb_closing_tag_error((MALFORMED_ERB_CLOSING_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2240
3254
  case STRAY_ERB_CLOSING_TAG_ERROR: error_pretty_print_stray_erb_closing_tag_error((STRAY_ERB_CLOSING_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2241
3255
  case NESTED_ERB_TAG_ERROR: error_pretty_print_nested_erb_tag_error((NESTED_ERB_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
2242
3256
  case RENDER_AMBIGUOUS_LOCALS_ERROR: error_pretty_print_render_ambiguous_locals_error((RENDER_AMBIGUOUS_LOCALS_ERROR_T*) error, indent, relative_indent, buffer); break;
@@ -2251,8 +3265,13 @@ void error_pretty_print(ERROR_T* error, const size_t indent, const size_t relati
2251
3265
  case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: error_pretty_print_strict_locals_splat_argument_error((STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T*) error, indent, relative_indent, buffer); break;
2252
3266
  case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: error_pretty_print_strict_locals_missing_parenthesis_error((STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T*) error, indent, relative_indent, buffer); break;
2253
3267
  case STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR: error_pretty_print_strict_locals_duplicate_declaration_error((STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T*) error, indent, relative_indent, buffer); break;
3268
+ case HERB_STATE_MISSING_PARENTHESIS_ERROR: error_pretty_print_herb_state_missing_parenthesis_error((HERB_STATE_MISSING_PARENTHESIS_ERROR_T*) error, indent, relative_indent, buffer); break;
3269
+ case HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR: error_pretty_print_herb_state_non_canonical_directive_error((HERB_STATE_NON_CANONICAL_DIRECTIVE_ERROR_T*) error, indent, relative_indent, buffer); break;
3270
+ case HERB_STATE_INVALID_PARAMETER_ERROR: error_pretty_print_herb_state_invalid_parameter_error((HERB_STATE_INVALID_PARAMETER_ERROR_T*) error, indent, relative_indent, buffer); break;
3271
+ case HERB_STATE_DUPLICATE_DECLARATION_ERROR: error_pretty_print_herb_state_duplicate_declaration_error((HERB_STATE_DUPLICATE_DECLARATION_ERROR_T*) error, indent, relative_indent, buffer); break;
2254
3272
  case VOID_ELEMENT_CONTENT_ERROR: error_pretty_print_void_element_content_error((VOID_ELEMENT_CONTENT_ERROR_T*) error, indent, relative_indent, buffer); break;
2255
3273
  case DOT_NOTATION_CASING_ERROR: error_pretty_print_dot_notation_casing_error((DOT_NOTATION_CASING_ERROR_T*) error, indent, relative_indent, buffer); break;
3274
+ case TIMEOUT_ERROR: error_pretty_print_timeout_error((TIMEOUT_ERROR_T*) error, indent, relative_indent, buffer); break;
2256
3275
  }
2257
3276
  }
2258
3277