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.
- checksums.yaml +4 -4
- data/Makefile +17 -7
- data/README.md +36 -119
- data/Rakefile +2 -11
- data/config/action_view_helpers/actioncable/action_cable_helper/action_cable_meta_tag.yml +12 -8
- data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy?.yml +9 -6
- data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy_nonce.yml +9 -6
- data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_path.yml +20 -12
- data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_url.yml +30 -18
- data/config/action_view_helpers/actionpack/request_forgery_protection/form_authenticity_token.yml +15 -9
- data/config/action_view_helpers/actionpack/request_forgery_protection/protect_against_forgery?.yml +9 -6
- data/config/action_view_helpers/actiontext/content_helper/render_action_text_content.yml +15 -9
- data/config/action_view_helpers/actiontext/content_helper/sanitize_action_text_content.yml +15 -9
- data/config/action_view_helpers/actiontext/tag_helper/rich_textarea_tag.yml +34 -22
- data/config/action_view_helpers/actionview/active_model_helper/error_message.yml +9 -6
- data/config/action_view_helpers/actionview/active_model_helper/error_wrapping.yml +9 -6
- data/config/action_view_helpers/actionview/active_model_helper/object.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/apply_stylesheet_media_default.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/audio_tag.yml +40 -27
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_discovery_link_tag.yml +37 -23
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_scripts.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_styles.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/favicon_link_tag.yml +32 -22
- data/config/action_view_helpers/actionview/asset_tag_helper/image_decoding.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/image_loading.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/image_tag.yml +67 -46
- data/config/action_view_helpers/actionview/asset_tag_helper/javascript_include_tag.yml +58 -39
- data/config/action_view_helpers/actionview/asset_tag_helper/picture_tag.yml +22 -14
- data/config/action_view_helpers/actionview/asset_tag_helper/preload_link_tag.yml +45 -30
- data/config/action_view_helpers/actionview/asset_tag_helper/preload_links_header.yml +9 -6
- data/config/action_view_helpers/actionview/asset_tag_helper/stylesheet_link_tag.yml +49 -30
- data/config/action_view_helpers/actionview/asset_tag_helper/video_tag.yml +53 -35
- data/config/action_view_helpers/actionview/asset_url_helper/asset_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/asset_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/audio_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/audio_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_extname.yml +9 -6
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_host.yml +9 -6
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_path.yml +9 -6
- data/config/action_view_helpers/actionview/asset_url_helper/font_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/font_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/image_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/image_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/javascript_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/javascript_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/public_compute_asset_path.yml +9 -6
- data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_url.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/video_path.yml +16 -10
- data/config/action_view_helpers/actionview/asset_url_helper/video_url.yml +16 -10
- data/config/action_view_helpers/actionview/atom_feed_helper/atom_feed.yml +52 -27
- data/config/action_view_helpers/actionview/cache_helper/cache.yml +25 -15
- data/config/action_view_helpers/actionview/cache_helper/cache_fragment_name.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/cache_if.yml +20 -12
- data/config/action_view_helpers/actionview/cache_helper/cache_unless.yml +20 -12
- data/config/action_view_helpers/actionview/cache_helper/caching_predicate.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/digest_path_from_template.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/fragment_for.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/fragment_name_with_digest.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/read_fragment_for.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/uncacheable.yml +9 -6
- data/config/action_view_helpers/actionview/cache_helper/write_fragment_for.yml +9 -6
- data/config/action_view_helpers/actionview/capture_helper/capture.yml +9 -6
- data/config/action_view_helpers/actionview/capture_helper/content_for.yml +20 -12
- data/config/action_view_helpers/actionview/capture_helper/content_for_predicate.yml +15 -9
- data/config/action_view_helpers/actionview/capture_helper/provide.yml +15 -9
- data/config/action_view_helpers/actionview/capture_helper/with_output_buffer.yml +9 -6
- data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prepend_content_exfiltration_prevention.yml +9 -6
- data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prevent_content_exfiltration.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/action_name.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/assign_controller.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/controller.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/controller_name.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/controller_path.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/cookies.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/flash.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/headers.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/logger.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/params.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/request.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/request_forgery_protection_token.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/response.yml +9 -6
- data/config/action_view_helpers/actionview/controller_helper/session.yml +9 -6
- data/config/action_view_helpers/actionview/csp_helper/csp_meta_tag.yml +18 -11
- data/config/action_view_helpers/actionview/csrf_helper/csrf_meta_tags.yml +16 -10
- data/config/action_view_helpers/actionview/date_helper/date_select.yml +85 -51
- data/config/action_view_helpers/actionview/date_helper/datetime_select.yml +65 -39
- data/config/action_view_helpers/actionview/date_helper/distance_of_time_in_words.yml +30 -18
- data/config/action_view_helpers/actionview/date_helper/relative_time_in_words.yml +35 -21
- data/config/action_view_helpers/actionview/date_helper/select_date.yml +50 -30
- data/config/action_view_helpers/actionview/date_helper/select_datetime.yml +65 -39
- data/config/action_view_helpers/actionview/date_helper/select_day.yml +40 -24
- data/config/action_view_helpers/actionview/date_helper/select_hour.yml +50 -30
- data/config/action_view_helpers/actionview/date_helper/select_minute.yml +40 -24
- data/config/action_view_helpers/actionview/date_helper/select_month.yml +60 -36
- data/config/action_view_helpers/actionview/date_helper/select_second.yml +35 -21
- data/config/action_view_helpers/actionview/date_helper/select_time.yml +55 -33
- data/config/action_view_helpers/actionview/date_helper/select_year.yml +45 -27
- data/config/action_view_helpers/actionview/date_helper/time_ago_in_words.yml +21 -13
- data/config/action_view_helpers/actionview/date_helper/time_select.yml +60 -36
- data/config/action_view_helpers/actionview/date_helper/time_tag.yml +32 -20
- data/config/action_view_helpers/actionview/debug_helper/debug.yml +15 -9
- data/config/action_view_helpers/actionview/form_builder/button.yml +60 -0
- data/config/action_view_helpers/actionview/form_builder/submit.yml +48 -0
- data/config/action_view_helpers/actionview/form_helper/apply_form_for_options.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/checkbox.yml +41 -25
- data/config/action_view_helpers/actionview/form_helper/color_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/date_field.yml +35 -21
- data/config/action_view_helpers/actionview/form_helper/datetime_field.yml +41 -25
- data/config/action_view_helpers/actionview/form_helper/email_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/emitted_hidden_id.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/fields.yml +37 -18
- data/config/action_view_helpers/actionview/form_helper/fields_for.yml +33 -15
- data/config/action_view_helpers/actionview/form_helper/file_field.yml +45 -27
- data/config/action_view_helpers/actionview/form_helper/form_for.yml +45 -24
- data/config/action_view_helpers/actionview/form_helper/form_with.yml +56 -30
- data/config/action_view_helpers/actionview/form_helper/form_with_generates_ids.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/form_with_generates_remote_forms.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/hidden_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/label.yml +52 -27
- data/config/action_view_helpers/actionview/form_helper/month_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/multipart.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/multiple_file_field_include_hidden.yml +9 -6
- data/config/action_view_helpers/actionview/form_helper/number_field.yml +45 -27
- data/config/action_view_helpers/actionview/form_helper/password_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/radio_button.yml +30 -18
- data/config/action_view_helpers/actionview/form_helper/range_field.yml +45 -27
- data/config/action_view_helpers/actionview/form_helper/search_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/telephone_field.yml +26 -16
- data/config/action_view_helpers/actionview/form_helper/text_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/textarea.yml +31 -19
- data/config/action_view_helpers/actionview/form_helper/time_field.yml +40 -24
- data/config/action_view_helpers/actionview/form_helper/url_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_helper/week_field.yml +25 -15
- data/config/action_view_helpers/actionview/form_options_helper/collection_checkboxes.yml +58 -31
- data/config/action_view_helpers/actionview/form_options_helper/collection_radio_buttons.yml +57 -30
- data/config/action_view_helpers/actionview/form_options_helper/collection_select.yml +65 -39
- data/config/action_view_helpers/actionview/form_options_helper/grouped_collection_select.yml +65 -39
- data/config/action_view_helpers/actionview/form_options_helper/grouped_options_for_select.yml +35 -21
- data/config/action_view_helpers/actionview/form_options_helper/option_groups_from_collection_for_select.yml +40 -24
- data/config/action_view_helpers/actionview/form_options_helper/options_for_select.yml +20 -12
- data/config/action_view_helpers/actionview/form_options_helper/options_from_collection_for_select.yml +30 -18
- data/config/action_view_helpers/actionview/form_options_helper/select.yml +60 -36
- data/config/action_view_helpers/actionview/form_options_helper/time_zone_options_for_select.yml +25 -15
- data/config/action_view_helpers/actionview/form_options_helper/time_zone_select.yml +50 -30
- data/config/action_view_helpers/actionview/form_options_helper/weekday_options_for_select.yml +30 -18
- data/config/action_view_helpers/actionview/form_options_helper/weekday_select.yml +30 -18
- data/config/action_view_helpers/actionview/form_tag_helper/button_tag.yml +39 -21
- data/config/action_view_helpers/actionview/form_tag_helper/checkbox_tag.yml +33 -21
- data/config/action_view_helpers/actionview/form_tag_helper/color_field_tag.yml +26 -17
- data/config/action_view_helpers/actionview/form_tag_helper/date_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/datetime_field_tag.yml +28 -18
- data/config/action_view_helpers/actionview/form_tag_helper/default_enforce_utf8.yml +9 -6
- data/config/action_view_helpers/actionview/form_tag_helper/email_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/embed_authenticity_token_in_remote_forms.yml +9 -6
- data/config/action_view_helpers/actionview/form_tag_helper/field_id.yml +30 -18
- data/config/action_view_helpers/actionview/form_tag_helper/field_name.yml +30 -18
- data/config/action_view_helpers/actionview/form_tag_helper/field_set_tag.yml +23 -15
- data/config/action_view_helpers/actionview/form_tag_helper/file_field_tag.yml +35 -22
- data/config/action_view_helpers/actionview/form_tag_helper/form_tag.yml +38 -24
- data/config/action_view_helpers/actionview/form_tag_helper/hidden_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/image_submit_tag.yml +31 -21
- data/config/action_view_helpers/actionview/form_tag_helper/label_tag.yml +33 -17
- data/config/action_view_helpers/actionview/form_tag_helper/month_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/number_field_tag.yml +47 -29
- data/config/action_view_helpers/actionview/form_tag_helper/password_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/radio_button_tag.yml +32 -20
- data/config/action_view_helpers/actionview/form_tag_helper/range_field_tag.yml +47 -29
- data/config/action_view_helpers/actionview/form_tag_helper/search_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/select_tag.yml +47 -29
- data/config/action_view_helpers/actionview/form_tag_helper/submit_tag.yml +33 -21
- data/config/action_view_helpers/actionview/form_tag_helper/telephone_field_tag.yml +28 -18
- data/config/action_view_helpers/actionview/form_tag_helper/text_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/textarea_tag.yml +31 -20
- data/config/action_view_helpers/actionview/form_tag_helper/time_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/url_field_tag.yml +27 -17
- data/config/action_view_helpers/actionview/form_tag_helper/utf8_enforcer_tag.yml +9 -6
- data/config/action_view_helpers/actionview/form_tag_helper/week_field_tag.yml +28 -18
- data/config/action_view_helpers/actionview/javascript_helper/escape_javascript.yml +16 -10
- data/config/action_view_helpers/actionview/javascript_helper/javascript_cdata_section.yml +9 -6
- data/config/action_view_helpers/actionview/javascript_helper/javascript_tag.yml +41 -27
- data/config/action_view_helpers/actionview/number_helper/number_to_currency.yml +29 -18
- data/config/action_view_helpers/actionview/number_helper/number_to_human.yml +25 -15
- data/config/action_view_helpers/actionview/number_helper/number_to_human_size.yml +20 -12
- data/config/action_view_helpers/actionview/number_helper/number_to_percentage.yml +20 -12
- data/config/action_view_helpers/actionview/number_helper/number_to_phone.yml +33 -20
- data/config/action_view_helpers/actionview/number_helper/number_with_delimiter.yml +21 -13
- data/config/action_view_helpers/actionview/number_helper/number_with_precision.yml +25 -15
- data/config/action_view_helpers/actionview/output_safety_helper/raw.yml +15 -9
- data/config/action_view_helpers/actionview/output_safety_helper/safe_join.yml +20 -12
- data/config/action_view_helpers/actionview/output_safety_helper/to_sentence.yml +24 -15
- data/config/action_view_helpers/actionview/record_identifier/dom_class.yml +20 -12
- data/config/action_view_helpers/actionview/record_identifier/dom_id.yml +20 -12
- data/config/action_view_helpers/actionview/record_identifier/dom_target.yml +15 -9
- data/config/action_view_helpers/actionview/record_identifier/model_name_from_record_or_class.yml +9 -6
- data/config/action_view_helpers/actionview/rendering_helper/render.yml +108 -22
- data/config/action_view_helpers/actionview/sanitize_helper/sanitize.yml +25 -15
- data/config/action_view_helpers/actionview/sanitize_helper/sanitize_css.yml +15 -9
- data/config/action_view_helpers/actionview/sanitize_helper/sanitizer_vendor.yml +9 -6
- data/config/action_view_helpers/actionview/sanitize_helper/strip_links.yml +15 -9
- data/config/action_view_helpers/actionview/sanitize_helper/strip_tags.yml +15 -9
- data/config/action_view_helpers/actionview/tag_helper/cdata_section.yml +15 -9
- data/config/action_view_helpers/actionview/tag_helper/content_tag.yml +59 -38
- data/config/action_view_helpers/actionview/tag_helper/escape_once.yml +15 -9
- data/config/action_view_helpers/actionview/tag_helper/tag.yml +54 -31
- data/config/action_view_helpers/actionview/tag_helper/token_list.yml +16 -10
- data/config/action_view_helpers/actionview/text_helper/concat.yml +15 -9
- data/config/action_view_helpers/actionview/text_helper/current_cycle.yml +15 -9
- data/config/action_view_helpers/actionview/text_helper/cycle.yml +23 -14
- data/config/action_view_helpers/actionview/text_helper/excerpt.yml +33 -20
- data/config/action_view_helpers/actionview/text_helper/highlight.yml +37 -18
- data/config/action_view_helpers/actionview/text_helper/pluralize.yml +30 -18
- data/config/action_view_helpers/actionview/text_helper/reset_cycle.yml +15 -9
- data/config/action_view_helpers/actionview/text_helper/safe_concat.yml +9 -6
- data/config/action_view_helpers/actionview/text_helper/simple_format.yml +33 -20
- data/config/action_view_helpers/actionview/text_helper/truncate.yml +38 -23
- data/config/action_view_helpers/actionview/text_helper/word_wrap.yml +25 -15
- data/config/action_view_helpers/actionview/translation_helper/debug_missing_translation.yml +9 -6
- data/config/action_view_helpers/actionview/translation_helper/localize.yml +26 -16
- data/config/action_view_helpers/actionview/translation_helper/translate.yml +31 -19
- data/config/action_view_helpers/actionview/url_helper/button_to.yml +57 -33
- data/config/action_view_helpers/actionview/url_helper/button_to_generates_button_tag.yml +9 -6
- data/config/action_view_helpers/actionview/url_helper/current_page?.yml +25 -15
- data/config/action_view_helpers/actionview/url_helper/link_to.yml +76 -53
- data/config/action_view_helpers/actionview/url_helper/link_to_if.yml +54 -20
- data/config/action_view_helpers/actionview/url_helper/link_to_unless.yml +54 -20
- data/config/action_view_helpers/actionview/url_helper/link_to_unless_current.yml +49 -17
- data/config/action_view_helpers/actionview/url_helper/mail_to.yml +60 -34
- data/config/action_view_helpers/actionview/url_helper/phone_to.yml +40 -22
- data/config/action_view_helpers/actionview/url_helper/sms_to.yml +45 -25
- data/config/action_view_helpers/actionview/url_helper/url_for.yml +15 -9
- data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_import_module_tag.yml +32 -0
- data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_importmap_module_preload_tags.yml +39 -0
- data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_importmap_tags.yml +35 -0
- data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_inline_importmap_tag.yml +32 -0
- data/config/action_view_helpers/importmap-rails/importmap_tags_helper/javascript_module_preload_tag.yml +35 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache.yml +9 -6
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache_tag.yml +12 -8
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview.yml +9 -6
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview_tag.yml +12 -8
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload.yml +9 -6
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload_tag.yml +12 -8
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_method_tag.yml +17 -11
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_scroll_tag.yml +17 -11
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refreshes_with.yml +20 -12
- data/config/action_view_helpers/turbo-rails/frames_helper/turbo_frame_tag.yml +54 -33
- data/config/action_view_helpers/turbo-rails/includes_helper/turbo_include_tags.yml +9 -6
- data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_action_tag.yml +32 -20
- data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_refresh_tag.yml +18 -11
- data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream.yml +9 -6
- data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream_from.yml +28 -18
- data/config/html_elements.yml +597 -0
- data/config/options.yml +1 -0
- data/config/slots/components.yml +52 -0
- data/config/state/kind.yml +61 -0
- data/config/state/operators.yml +27 -0
- data/config/state/predicates.yml +39 -0
- data/config/state/transforms.yml +18 -0
- data/config/view_context_methods/actionview/base/annotate_rendered_view_with_filenames.yml +4 -4
- data/config/view_context_methods/actionview/base/assign.yml +4 -4
- data/config/view_context_methods/actionview/base/assigns.yml +4 -4
- data/config/view_context_methods/actionview/base/automatically_disable_submit_tag.yml +4 -4
- data/config/view_context_methods/actionview/base/compiled_method_container.yml +4 -4
- data/config/view_context_methods/actionview/base/config.yml +4 -4
- data/config/view_context_methods/actionview/base/default_form_builder.yml +4 -4
- data/config/view_context_methods/actionview/base/default_formats.yml +4 -4
- data/config/view_context_methods/actionview/base/field_error_proc.yml +4 -4
- data/config/view_context_methods/actionview/base/formats.yml +4 -4
- data/config/view_context_methods/actionview/base/in_rendering_context.yml +4 -4
- data/config/view_context_methods/actionview/base/locale.yml +4 -4
- data/config/view_context_methods/actionview/base/lookup_context.yml +4 -4
- data/config/view_context_methods/actionview/base/output_buffer.yml +4 -4
- data/config/view_context_methods/actionview/base/prefix_partial_path_with_controller_namespace.yml +4 -4
- data/config/view_context_methods/actionview/base/remove_hidden_field_autocomplete.yml +4 -4
- data/config/view_context_methods/actionview/base/streaming_completion_on_exception.yml +4 -4
- data/config/view_context_methods/actionview/base/view_flow.yml +4 -4
- data/config/view_context_methods/actionview/base/view_paths.yml +4 -4
- data/config/view_context_methods/actionview/base/view_renderer.yml +4 -4
- data/config/view_context_methods/actionview/template/local_assigns.yml +4 -4
- data/config/view_context_methods/activemodel/conversion/convert_to_model.yml +4 -4
- data/config/view_context_methods/activesupport/benchmarkable/benchmark.yml +4 -4
- data/config.yml +1249 -786
- data/exe/herb +2 -0
- data/ext/herb/error_helpers.c +379 -17
- data/ext/herb/error_helpers.h +1 -1
- data/ext/herb/extconf.rb +4 -2
- data/ext/herb/extension.c +137 -74
- data/ext/herb/extension_helpers.c +81 -35
- data/ext/herb/extension_helpers.h +4 -1
- data/ext/herb/nodes.c +859 -374
- data/ext/herb/nodes.h +3 -2
- data/ext/herb/parser_options_helpers.c +151 -0
- data/ext/herb/parser_options_helpers.h +14 -0
- data/herb.gemspec +3 -2
- data/lib/herb/action_view/helper_registry.rb +1358 -62
- data/lib/herb/analysis/partial_declaration.rb +140 -0
- data/lib/herb/analysis/partial_index.rb +189 -0
- data/lib/herb/analysis/partial_resolution.rb +161 -0
- data/lib/herb/analysis/partial_resolver.rb +144 -0
- data/lib/herb/analysis/project_index.rb +152 -0
- data/lib/herb/{action_view → analysis}/render_analyzer.rb +287 -77
- data/lib/herb/analysis/render_graph/ancestor_chain.rb +27 -0
- data/lib/herb/analysis/render_graph/builder.rb +376 -0
- data/lib/herb/analysis/render_graph/call_frame.rb +9 -0
- data/lib/herb/analysis/render_graph/call_site_location.rb +23 -0
- data/lib/herb/analysis/render_graph/inferred_signature.rb +21 -0
- data/lib/herb/analysis/render_graph/partial_call_site.rb +40 -0
- data/lib/herb/analysis/render_graph/partial_context.rb +46 -0
- data/lib/herb/analysis/render_graph/template_roots.rb +31 -0
- data/lib/herb/analysis/render_graph.rb +285 -0
- data/lib/herb/analysis/ruby_locals_index/local.rb +25 -0
- data/lib/herb/analysis/ruby_locals_index/named_reference.rb +22 -0
- data/lib/herb/analysis/ruby_locals_index/offset_table.rb +44 -0
- data/lib/herb/analysis/ruby_locals_index/reference_collector.rb +80 -0
- data/lib/herb/analysis/ruby_locals_index/state_locals.rb +49 -0
- data/lib/herb/analysis/ruby_locals_index.rb +165 -0
- data/lib/herb/analysis/ruby_reference.rb +67 -0
- data/lib/herb/analysis/template_dependencies/dependency_collector.rb +179 -0
- data/lib/herb/analysis/template_dependencies/node_dependency_collector.rb +309 -0
- data/lib/herb/analysis/template_dependencies.rb +562 -0
- data/lib/herb/ast/erb_render_node.rb +26 -94
- data/lib/herb/ast/helpers.rb +90 -10
- data/lib/herb/ast/herb_directive_node.rb +18 -0
- data/lib/herb/ast/node.rb +32 -2
- data/lib/herb/ast/nodes.rb +1368 -105
- data/lib/herb/backend.rb +73 -0
- data/lib/herb/bootstrap.rb +8 -8
- data/lib/herb/cli.rb +555 -32
- data/lib/herb/colors.rb +14 -0
- data/lib/herb/configuration.rb +71 -35
- data/lib/herb/defaults.yml +2 -1
- data/lib/herb/dev/assets.rb +57 -0
- data/lib/herb/dev/classifier.rb +84 -0
- data/lib/herb/dev/embedded.rb +27 -0
- data/lib/herb/dev/pipeline.rb +305 -0
- data/lib/herb/dev/protocol.rb +221 -0
- data/lib/herb/dev/runner.rb +180 -175
- data/lib/herb/dev/server.rb +89 -26
- data/lib/herb/dev/server_entry.rb +41 -6
- data/lib/herb/dev/watcher.rb +181 -0
- data/lib/herb/dev.rb +163 -0
- data/lib/herb/diagnostic/formatter.rb +88 -0
- data/lib/herb/diagnostic.rb +172 -0
- data/lib/herb/diff/operation.rb +36 -0
- data/lib/herb/diff/result.rb +62 -0
- data/lib/herb/diff.rb +10 -0
- data/lib/herb/engine/collector.rb +62 -0
- data/lib/herb/engine/compiler.rb +387 -113
- data/lib/herb/engine/component_tags/constant_resolver.rb +28 -0
- data/lib/herb/engine/component_tags/partial_resolver.rb +54 -0
- data/lib/herb/engine/component_tags/resolver.rb +32 -0
- data/lib/herb/engine/component_tags/visitor.rb +231 -0
- data/lib/herb/engine/css_inliner/inliner.rb +101 -0
- data/lib/herb/engine/css_inliner/visitor.rb +174 -0
- data/lib/herb/engine/errors.rb +122 -0
- data/lib/herb/engine/helpers.rb +82 -0
- data/lib/herb/engine/inline_render/inliner.rb +122 -0
- data/lib/herb/engine/inline_render/visitor.rb +267 -0
- data/lib/herb/engine/runtime/entry.rb +62 -0
- data/lib/herb/engine/runtime/error_page.rb +362 -0
- data/lib/herb/engine/runtime/html_safe_assertions.rb +217 -0
- data/lib/herb/engine/runtime/journal/summary.rb +227 -0
- data/lib/herb/engine/runtime/journal.rb +379 -0
- data/lib/herb/engine/runtime/middleware.rb +212 -0
- data/lib/herb/engine/runtime/observations.rb +73 -0
- data/lib/herb/engine/runtime/report.rb +204 -0
- data/lib/herb/engine/runtime/session.rb +437 -0
- data/lib/herb/engine/runtime.rb +21 -0
- data/lib/herb/engine/scoped_style/channel.rb +66 -0
- data/lib/herb/engine/scoped_style/collector.rb +74 -0
- data/lib/herb/engine/scoped_style/visitor.rb +533 -0
- data/lib/herb/engine/slots/annotation.rb +98 -0
- data/lib/herb/engine/slots/bindings.rb +61 -0
- data/lib/herb/engine/slots/callee.rb +118 -0
- data/lib/herb/engine/slots/component_definitions.rb +67 -0
- data/lib/herb/engine/slots/components/async.rb +24 -0
- data/lib/herb/engine/slots/components/base.rb +132 -0
- data/lib/herb/engine/slots/components/deferred.rb +81 -0
- data/lib/herb/engine/slots/components/fallback.rb +27 -0
- data/lib/herb/engine/slots/components/fragment.rb +99 -0
- data/lib/herb/engine/slots/components/lazy.rb +24 -0
- data/lib/herb/engine/slots/components.rb +52 -0
- data/lib/herb/engine/slots/dependencies/channel.rb +72 -0
- data/lib/herb/engine/slots/dependencies.rb +269 -0
- data/lib/herb/engine/slots/dynamics_compiler.rb +864 -0
- data/lib/herb/engine/slots/identifier.rb +35 -0
- data/lib/herb/engine/slots/manifest/channel.rb +74 -0
- data/lib/herb/engine/slots/manifest/collector.rb +75 -0
- data/lib/herb/engine/slots/markers.rb +152 -0
- data/lib/herb/engine/slots/render_bindings.rb +141 -0
- data/lib/herb/engine/slots/schema_compiler.rb +94 -0
- data/lib/herb/engine/slots/state_anchor.rb +94 -0
- data/lib/herb/engine/slots/state_compiler.rb +1325 -0
- data/lib/herb/engine/slots/state_directives.rb +854 -0
- data/lib/herb/engine/slots/state_kinds.rb +54 -0
- data/lib/herb/engine/slots/state_operators.rb +36 -0
- data/lib/herb/engine/slots/state_overrides.rb +79 -0
- data/lib/herb/engine/slots/state_predicates.rb +65 -0
- data/lib/herb/engine/slots/state_transforms.rb +42 -0
- data/lib/herb/engine/slots/statics.rb +185 -0
- data/lib/herb/engine/slots/subtree.rb +82 -0
- data/lib/herb/engine/slots/subtree_compiler.rb +255 -0
- data/lib/herb/engine/slots/types.rb +42 -0
- data/lib/herb/engine/slots/visitor.rb +2267 -0
- data/lib/herb/engine/validators/accessibility_validator.rb +3 -3
- data/lib/herb/engine/validators/base.rb +36 -0
- data/lib/herb/engine/validators/generator_template_validator.rb +39 -0
- data/lib/herb/engine/validators/nesting_validator.rb +3 -3
- data/lib/herb/engine/validators/render_validator.rb +13 -33
- data/lib/herb/engine/validators/security_validator.rb +3 -17
- data/lib/herb/engine/validators.rb +43 -0
- data/lib/herb/engine/visitors/auto_close_omitted_tags_visitor.rb +48 -0
- data/lib/herb/engine/visitors/content_for_visitor.rb +127 -0
- data/lib/herb/engine/{debug_visitor.rb → visitors/debug_visitor.rb} +122 -94
- data/lib/herb/engine/visitors/html_safe_assertions_visitor.rb +281 -0
- data/lib/herb/engine/visitors/instrumentation_visitor.rb +290 -0
- data/lib/herb/engine/visitors/optimize_visitor.rb +728 -0
- data/lib/herb/engine/visitors/remove_comments_visitor.rb +106 -0
- data/lib/herb/engine/visitors/source_attribution_visitor.rb +177 -0
- data/lib/herb/engine.rb +218 -259
- data/lib/herb/ensure_installed.rb +43 -0
- data/lib/herb/errors.rb +681 -153
- data/lib/herb/fingerprint.rb +82 -0
- data/lib/herb/html/elements.rb +18 -0
- data/lib/herb/html/util.rb +21 -2
- data/lib/herb/lex_result.rb +0 -10
- data/lib/herb/locate.rb +163 -0
- data/lib/herb/location.rb +20 -0
- data/lib/herb/parse_result.rb +17 -11
- data/lib/herb/parser_options.rb +69 -40
- data/lib/herb/position.rb +19 -0
- data/lib/herb/prism_inspect.rb +1 -4
- data/lib/herb/project.rb +39 -23
- data/lib/herb/range.rb +5 -0
- data/lib/herb/result.rb +2 -2
- data/lib/herb/ruby_program.rb +110 -0
- data/lib/herb/source_path.rb +232 -0
- data/lib/herb/token.rb +14 -3
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor/context/origin.rb +52 -0
- data/lib/herb/visitor/context/replacements.rb +59 -0
- data/lib/herb/visitor/context.rb +169 -0
- data/lib/herb/visitor/context_aware.rb +45 -0
- data/lib/herb/visitor/diagnostics.rb +148 -0
- data/lib/herb/visitor/experimental.rb +33 -0
- data/lib/herb/visitor/parser_option_requirements.rb +151 -0
- data/lib/herb/visitor/stack.rb +192 -0
- data/lib/herb/visitor.rb +47 -1
- data/lib/herb/warnings.rb +25 -0
- data/lib/herb.rb +74 -63
- data/sig/herb/action_view/helper_registry.rbs +82 -10
- data/sig/herb/analysis/partial_declaration.rbs +80 -0
- data/sig/herb/analysis/partial_index.rbs +66 -0
- data/sig/herb/analysis/partial_resolution.rbs +57 -0
- data/sig/herb/analysis/partial_resolver.rbs +76 -0
- data/sig/herb/analysis/project_index.rbs +57 -0
- data/sig/herb/{action_view → analysis}/render_analyzer.rbs +25 -4
- data/sig/herb/analysis/render_graph/ancestor_chain.rbs +22 -0
- data/sig/herb/analysis/render_graph/builder.rbs +180 -0
- data/sig/herb/analysis/render_graph/call_frame.rbs +26 -0
- data/sig/herb/analysis/render_graph/call_site_location.rbs +28 -0
- data/sig/herb/analysis/render_graph/inferred_signature.rbs +27 -0
- data/sig/herb/analysis/render_graph/partial_call_site.rbs +36 -0
- data/sig/herb/analysis/render_graph/partial_context.rbs +31 -0
- data/sig/herb/analysis/render_graph/template_roots.rbs +32 -0
- data/sig/herb/analysis/render_graph.rbs +83 -0
- data/sig/herb/analysis/ruby_locals_index/local.rbs +21 -0
- data/sig/herb/analysis/ruby_locals_index/named_reference.rbs +20 -0
- data/sig/herb/analysis/ruby_locals_index/offset_table.rbs +26 -0
- data/sig/herb/analysis/ruby_locals_index/reference_collector.rbs +40 -0
- data/sig/herb/analysis/ruby_locals_index/state_locals.rbs +19 -0
- data/sig/herb/analysis/ruby_locals_index.rbs +62 -0
- data/sig/herb/analysis/ruby_reference.rbs +28 -0
- data/sig/herb/analysis/template_dependencies/dependency_collector.rbs +52 -0
- data/sig/herb/analysis/template_dependencies/node_dependency_collector.rbs +81 -0
- data/sig/herb/analysis/template_dependencies.rbs +125 -0
- data/sig/herb/ast/erb_render_node.rbs +10 -2
- data/sig/herb/ast/helpers.rbs +31 -1
- data/sig/herb/ast/herb_directive_node.rbs +13 -0
- data/sig/herb/ast/node.rbs +9 -0
- data/sig/herb/ast/nodes.rbs +668 -89
- data/sig/herb/backend.rbs +52 -0
- data/sig/herb/bootstrap.rbs +2 -0
- data/sig/herb/colors.rbs +3 -0
- data/sig/herb/configuration.rbs +27 -3
- data/sig/herb/dev/assets.rbs +27 -0
- data/sig/herb/dev/classifier.rbs +57 -0
- data/sig/herb/dev/embedded.rbs +21 -0
- data/sig/herb/dev/pipeline.rbs +118 -0
- data/sig/herb/dev/protocol.rbs +78 -0
- data/sig/herb/dev/runner.rbs +64 -23
- data/sig/herb/dev/server.rbs +49 -22
- data/sig/herb/dev/server_entry.rbs +46 -21
- data/sig/herb/dev/watcher.rbs +84 -0
- data/sig/herb/dev.rbs +58 -0
- data/sig/herb/diagnostic/formatter.rbs +28 -0
- data/sig/herb/diagnostic.rbs +88 -0
- data/sig/herb/diff/operation.rbs +36 -0
- data/sig/herb/diff/result.rbs +36 -0
- data/sig/herb/diff.rbs +6 -0
- data/sig/herb/engine/collector.rbs +48 -0
- data/sig/herb/engine/compiler.rbs +74 -24
- data/sig/herb/engine/component_tags/constant_resolver.rbs +19 -0
- data/sig/herb/engine/component_tags/partial_resolver.rbs +30 -0
- data/sig/herb/engine/component_tags/resolver.rbs +25 -0
- data/sig/herb/engine/component_tags/visitor.rbs +69 -0
- data/sig/herb/engine/css_inliner/inliner.rbs +65 -0
- data/sig/herb/engine/css_inliner/visitor.rbs +87 -0
- data/sig/herb/engine/errors.rbs +68 -0
- data/sig/herb/engine/helpers.rbs +28 -0
- data/sig/herb/engine/inline_render/inliner.rbs +39 -0
- data/sig/herb/engine/inline_render/visitor.rbs +104 -0
- data/sig/herb/engine/runtime/entry.rbs +43 -0
- data/sig/herb/engine/runtime/error_page.rbs +115 -0
- data/sig/herb/engine/runtime/html_safe_assertions.rbs +99 -0
- data/sig/herb/engine/runtime/journal/summary.rbs +172 -0
- data/sig/herb/engine/runtime/journal.rbs +126 -0
- data/sig/herb/engine/runtime/middleware.rbs +96 -0
- data/sig/herb/engine/runtime/observations.rbs +38 -0
- data/sig/herb/engine/runtime/report.rbs +97 -0
- data/sig/herb/engine/runtime/session.rbs +233 -0
- data/sig/herb/engine/runtime.rbs +14 -0
- data/sig/herb/engine/scoped_style/channel.rbs +45 -0
- data/sig/herb/engine/scoped_style/collector.rbs +45 -0
- data/sig/herb/engine/scoped_style/visitor.rbs +220 -0
- data/sig/herb/engine/slots/annotation.rbs +72 -0
- data/sig/herb/engine/slots/bindings.rbs +34 -0
- data/sig/herb/engine/slots/callee.rbs +62 -0
- data/sig/herb/engine/slots/component_definitions.rbs +19 -0
- data/sig/herb/engine/slots/components/async.rbs +20 -0
- data/sig/herb/engine/slots/components/base.rbs +60 -0
- data/sig/herb/engine/slots/components/deferred.rbs +29 -0
- data/sig/herb/engine/slots/components/fallback.rbs +21 -0
- data/sig/herb/engine/slots/components/fragment.rbs +34 -0
- data/sig/herb/engine/slots/components/lazy.rbs +20 -0
- data/sig/herb/engine/slots/components.rbs +30 -0
- data/sig/herb/engine/slots/dependencies/channel.rbs +51 -0
- data/sig/herb/engine/slots/dependencies.rbs +94 -0
- data/sig/herb/engine/slots/dynamics_compiler.rbs +352 -0
- data/sig/herb/engine/slots/identifier.rbs +19 -0
- data/sig/herb/engine/slots/manifest/channel.rbs +49 -0
- data/sig/herb/engine/slots/manifest/collector.rbs +45 -0
- data/sig/herb/engine/slots/markers.rbs +99 -0
- data/sig/herb/engine/slots/render_bindings.rbs +69 -0
- data/sig/herb/engine/slots/schema_compiler.rbs +62 -0
- data/sig/herb/engine/slots/state_anchor.rbs +41 -0
- data/sig/herb/engine/slots/state_compiler.rbs +258 -0
- data/sig/herb/engine/slots/state_directives.rbs +278 -0
- data/sig/herb/engine/slots/state_kinds.rbs +24 -0
- data/sig/herb/engine/slots/state_operators.rbs +19 -0
- data/sig/herb/engine/slots/state_overrides.rbs +33 -0
- data/sig/herb/engine/slots/state_predicates.rbs +16 -0
- data/sig/herb/engine/slots/state_transforms.rbs +15 -0
- data/sig/herb/engine/slots/statics.rbs +67 -0
- data/sig/herb/engine/slots/subtree.rbs +49 -0
- data/sig/herb/engine/slots/subtree_compiler.rbs +130 -0
- data/sig/herb/engine/slots/types.rbs +46 -0
- data/sig/herb/engine/slots/visitor.rbs +603 -0
- data/sig/herb/engine/validators/accessibility_validator.rbs +1 -1
- data/sig/herb/engine/validators/base.rbs +28 -0
- data/sig/herb/engine/validators/generator_template_validator.rbs +19 -0
- data/sig/herb/engine/validators/nesting_validator.rbs +1 -1
- data/sig/herb/engine/validators/render_validator.rbs +2 -6
- data/sig/herb/engine/validators/security_validator.rbs +1 -3
- data/sig/herb/engine/validators.rbs +21 -0
- data/sig/herb/engine/visitors/auto_close_omitted_tags_visitor.rbs +26 -0
- data/sig/herb/engine/visitors/content_for_visitor.rbs +52 -0
- data/sig/herb/engine/{debug_visitor.rbs → visitors/debug_visitor.rbs} +26 -15
- data/sig/herb/engine/visitors/html_safe_assertions_visitor.rbs +100 -0
- data/sig/herb/engine/visitors/instrumentation_visitor.rbs +111 -0
- data/sig/herb/engine/visitors/optimize_visitor.rbs +246 -0
- data/sig/herb/engine/visitors/remove_comments_visitor.rbs +66 -0
- data/sig/herb/engine/visitors/source_attribution_visitor.rbs +90 -0
- data/sig/herb/engine.rbs +47 -41
- data/sig/herb/ensure_installed.rbs +9 -0
- data/sig/herb/errors.rbs +311 -0
- data/sig/herb/fingerprint.rbs +37 -0
- data/sig/herb/html/elements.rbs +19 -0
- data/sig/herb/html/util.rbs +15 -1
- data/sig/herb/lex_result.rbs +0 -6
- data/sig/herb/locate.rbs +89 -0
- data/sig/herb/location.rbs +12 -0
- data/sig/herb/parse_result.rbs +10 -8
- data/sig/herb/parser_options.rbs +53 -19
- data/sig/herb/position.rbs +11 -0
- data/sig/herb/range.rbs +3 -0
- data/sig/herb/ruby_program.rbs +51 -0
- data/sig/herb/source_path.rbs +132 -0
- data/sig/herb/token.rbs +5 -2
- data/sig/herb/visitor/context/origin.rbs +51 -0
- data/sig/herb/visitor/context/replacements.rbs +39 -0
- data/sig/herb/visitor/context.rbs +83 -0
- data/sig/herb/visitor/context_aware.rbs +32 -0
- data/sig/herb/visitor/diagnostics.rbs +82 -0
- data/sig/herb/visitor/experimental.rbs +23 -0
- data/sig/herb/visitor/parser_option_requirements.rbs +76 -0
- data/sig/herb/visitor/stack.rbs +91 -0
- data/sig/herb/visitor.rbs +22 -0
- data/sig/herb/warnings.rbs +10 -0
- data/sig/herb.rbs +27 -10
- data/sig/manifest.yaml +13 -0
- data/sig/serialized_ast_errors.rbs +62 -1
- data/sig/serialized_ast_nodes.rbs +59 -2
- data/src/analyze/action_view/attribute_extraction_helpers.c +73 -36
- data/src/analyze/action_view/generated_handlers.c +37 -1
- data/src/analyze/action_view/generated_handlers.h +2 -1
- data/src/analyze/action_view/helper_registry.c +1353 -58
- data/src/analyze/action_view/registry.c +10 -17
- data/src/analyze/action_view/stylesheet_link_tag.c +40 -0
- data/src/analyze/action_view/tag_helper_node_builders.c +63 -3
- data/src/analyze/action_view/tag_helpers.c +502 -111
- data/src/analyze/analyze.c +306 -89
- data/src/analyze/analyze_helpers.c +502 -237
- data/src/analyze/analyzed_ruby.c +2 -0
- data/src/analyze/builders.c +80 -51
- data/src/analyze/conditional_elements.c +13 -8
- data/src/analyze/conditional_open_tags.c +11 -5
- data/src/analyze/control_type.c +36 -13
- data/src/analyze/herb_directives.c +701 -0
- data/src/analyze/invalid_structures.c +11 -7
- data/src/analyze/iteration_nodes.c +306 -0
- data/src/analyze/missing_end.c +116 -32
- data/src/analyze/parse_errors.c +8 -3
- data/src/analyze/postfix_conditionals.c +98 -63
- data/src/analyze/prism_annotate.c +45 -13
- data/src/analyze/render_nodes.c +348 -123
- data/src/analyze/strict_locals.c +30 -26
- data/src/analyze/ternary_conditionals.c +95 -70
- data/src/analyze/transform.c +43 -1
- data/src/ast/ast_node.c +3 -13
- data/src/ast/ast_nodes.c +914 -113
- data/src/ast/ast_pretty_print.c +166 -3
- data/src/diff/herb_diff.c +8 -0
- data/src/diff/herb_diff_attributes.c +1 -0
- data/src/diff/herb_diff_children.c +4 -3
- data/src/diff/herb_diff_helpers.c +7 -1
- data/src/diff/herb_diff_nodes.c +186 -71
- data/src/diff/herb_hash_tree.c +99 -1
- data/src/errors.c +1124 -105
- data/src/extract.c +227 -144
- data/src/herb.c +43 -8
- data/src/include/analyze/action_view/attribute_extraction_helpers.h +1 -1
- data/src/include/analyze/action_view/helper_registry.h +28 -4
- data/src/include/analyze/action_view/tag_helper_handler.h +1 -1
- data/src/include/analyze/action_view/tag_helper_node_builders.h +7 -0
- data/src/include/analyze/analyze.h +11 -22
- data/src/include/analyze/analyzed_ruby.h +25 -0
- data/src/include/analyze/builders.h +16 -0
- data/src/include/analyze/helpers.h +25 -24
- data/src/include/analyze/herb_directive_kinds.h +41 -0
- data/src/include/analyze/herb_directives.h +14 -0
- data/src/include/analyze/iteration_nodes.h +11 -0
- data/src/include/analyze/prism_annotate.h +3 -3
- data/src/include/analyze/ternary_conditionals.h +2 -0
- data/src/include/ast/ast_node.h +1 -5
- data/src/include/ast/ast_nodes.h +78 -3
- data/src/include/ast/ast_pretty_print.h +1 -1
- data/src/include/diff/herb_diff.h +11 -0
- data/src/include/errors.h +163 -38
- data/src/include/extract.h +11 -0
- data/src/include/herb.h +6 -0
- data/src/include/lexer/erb_openers.h +29 -0
- data/src/include/lexer/lexer.h +1 -0
- data/src/include/lexer/lexer_peek_helpers.h +8 -1
- data/src/include/lexer/lexer_struct.h +4 -0
- data/src/include/lexer/token.h +5 -0
- data/src/include/lexer/token_struct.h +8 -6
- data/src/include/lib/hb_allocator.h +2 -1
- data/src/include/lib/hb_array.h +2 -0
- data/src/include/lib/hb_clock.h +15 -0
- data/src/include/lib/hb_foreach.h +1 -1
- data/src/include/lib/hb_string.h +7 -0
- data/src/include/parser/dot_notation.h +1 -1
- data/src/include/parser/foreign_content_elements.h +32 -0
- data/src/include/parser/parser.h +40 -26
- data/src/include/parser/parser_helpers.h +13 -11
- data/src/include/parser/parser_options.h +41 -0
- data/src/include/prism/herb_prism_node.h +6 -1
- data/src/include/prism/ruby_parser.h +6 -0
- data/src/include/util/html_elements.h +85 -0
- data/src/include/util/html_util.h +1 -0
- data/src/include/version.h +1 -1
- data/src/lexer/lexer_peek_helpers.c +15 -1
- data/src/lexer/token.c +89 -1
- data/src/lexer.c +228 -12
- data/src/lib/hb_allocator.c +2 -0
- data/src/lib/hb_array.c +26 -0
- data/src/lib/hb_string.c +26 -0
- data/src/main.c +1 -1
- data/src/parser/dot_notation.c +4 -3
- data/src/parser/match_tags.c +66 -1
- data/src/parser/parser_helpers.c +69 -37
- data/src/parser.c +658 -385
- data/src/parser_options_defaults.c +30 -0
- data/src/prism/prism_helpers.c +94 -0
- data/src/prism/ruby_parser.c +49 -0
- data/src/util/html_util.c +11 -58
- data/src/visitor.c +77 -1
- data/templates/ext/herb/error_helpers.c.erb +1 -1
- data/templates/ext/herb/nodes.c.erb +19 -14
- data/templates/ext/herb/nodes.h.erb +2 -1
- data/templates/ext/herb/parser_options_helpers.c.erb +69 -0
- data/templates/ext/herb/parser_options_helpers.h.erb +11 -0
- data/templates/java/nodes.c.erb +21 -17
- data/templates/java/nodes.h.erb +3 -2
- data/templates/java/org/herb/ParserOptions.java.erb +24 -0
- data/templates/java/org/herb/ast/HelperRegistry.java.erb +67 -31
- data/templates/java/org/herb/ast/HelperType.java.erb +29 -0
- data/templates/java/org/herb/ast/Nodes.java.erb +11 -7
- data/templates/java/parser_options_helpers.c.erb +45 -0
- data/templates/java/parser_options_helpers.h.erb +10 -0
- data/templates/javascript/packages/client/src/state-kinds.ts.erb +49 -0
- data/templates/javascript/packages/client/src/state-operators.ts.erb +15 -0
- data/templates/javascript/packages/client/src/state-predicates.ts.erb +27 -0
- data/templates/javascript/packages/client/src/state-transforms.ts.erb +19 -0
- data/templates/javascript/packages/core/src/action-view-helpers.ts.erb +47 -0
- data/templates/javascript/packages/core/src/built-in-components.ts.erb +67 -0
- data/templates/javascript/packages/core/src/errors.ts.erb +9 -3
- data/templates/javascript/packages/core/src/foreign-content-elements.ts.erb +18 -0
- data/templates/javascript/packages/core/src/html-constants.ts.erb +32 -0
- data/templates/javascript/packages/core/src/html-elements.ts.erb +41 -0
- data/templates/javascript/packages/core/src/node-type-guards.ts.erb +11 -7
- data/templates/javascript/packages/core/src/nodes.ts.erb +103 -20
- data/templates/javascript/packages/core/src/parser-options.ts.erb +41 -0
- data/templates/javascript/packages/core/src/visitor.ts.erb +1 -1
- data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +3 -3
- data/templates/javascript/packages/node/extension/nodes.cpp.erb +18 -13
- data/templates/javascript/packages/node/extension/nodes.h.erb +3 -3
- data/templates/javascript/packages/node/extension/parser_options_helpers.cpp.erb +41 -0
- data/templates/javascript/packages/node/extension/parser_options_helpers.h.erb +12 -0
- data/templates/lib/herb/action_view/helper_registry.rb.erb +77 -3
- data/templates/lib/herb/ast/nodes.rb.erb +16 -6
- data/templates/lib/herb/engine/slots/component_definitions.rb.erb +38 -0
- data/templates/lib/herb/engine/slots/state_kinds.rb.erb +37 -0
- data/templates/lib/herb/engine/slots/state_operators.rb.erb +26 -0
- data/templates/lib/herb/engine/slots/state_predicates.rb.erb +39 -0
- data/templates/lib/herb/engine/slots/state_transforms.rb.erb +27 -0
- data/templates/lib/herb/errors.rb.erb +34 -6
- data/templates/lib/herb/html/elements.rb.erb +12 -0
- data/templates/lib/herb/parser_options.rb.erb +32 -0
- data/templates/lib/herb/visitor.rb.erb +7 -1
- data/templates/rust/herb-printer/src/printer_visitor.rs.erb +14 -0
- data/templates/rust/src/action_view_helpers.rs.erb +38 -0
- data/templates/rust/src/ast/nodes.rs.erb +21 -31
- data/templates/rust/src/errors.rs.erb +1 -1
- data/templates/rust/src/nodes.rs.erb +58 -26
- data/templates/rust/src/parser_options.rs.erb +16 -0
- data/templates/rust/src/prism/generated_deserialize.rs.erb +109 -0
- data/templates/rust/src/prism/generated_prettyprint.rs.erb +153 -0
- data/templates/rust/src/union_types.rs.erb +7 -1
- data/templates/rust/src/visitor.rs.erb +1 -1
- data/templates/src/analyze/action_view/helper_registry.c.erb +22 -0
- data/templates/src/analyze/missing_end.c.erb +13 -5
- data/templates/src/ast/ast_nodes.c.erb +41 -2
- data/templates/src/diff/herb_diff_nodes.c.erb +44 -8
- data/templates/src/errors.c.erb +8 -3
- data/templates/src/include/analyze/action_view/helper_registry.h.erb +19 -0
- data/templates/src/include/analyze/herb_directive_kinds.h.erb +25 -0
- data/templates/src/include/errors.h.erb +3 -1
- data/templates/src/include/parser/foreign_content_elements.h.erb +23 -0
- data/templates/src/include/parser/parser_options.h.erb +21 -0
- data/templates/src/include/util/html_elements.h.erb +28 -0
- data/templates/src/parser_options_defaults.c.erb +9 -0
- data/templates/template.rb +564 -9
- data/templates/wasm/error_helpers.cpp.erb +4 -4
- data/templates/wasm/nodes.cpp.erb +17 -27
- data/templates/wasm/nodes.h.erb +3 -3
- data/templates/wasm/parser_options_helpers.cpp.erb +25 -0
- data/templates/wasm/parser_options_helpers.h.erb +12 -0
- metadata +309 -30
- data/config/action_view_helpers/actionview/form_helper/button.yml +0 -38
- data/config/action_view_helpers/actionview/form_helper/submit.yml +0 -35
- data/lib/herb/ast.rb +0 -7
- data/lib/herb/diff_operation.rb +0 -34
- data/lib/herb/diff_result.rb +0 -59
- data/lib/herb/engine/error_formatter.rb +0 -432
- data/lib/herb/engine/parser_error_overlay.rb +0 -771
- data/lib/herb/engine/validation_error_overlay.rb +0 -182
- data/lib/herb/engine/validation_errors.rb +0 -65
- data/lib/herb/engine/validator.rb +0 -80
- data/sig/herb/ast.rbs +0 -6
- data/sig/herb/diff_operation.rbs +0 -34
- data/sig/herb/diff_result.rbs +0 -34
- data/sig/herb/engine/debug.rbs +0 -38
- data/sig/herb/engine/error_formatter.rbs +0 -47
- data/sig/herb/engine/parser_error_overlay.rbs +0 -41
- data/sig/herb/engine/validation_error_overlay.rbs +0 -35
- data/sig/herb/engine/validation_errors.rbs +0 -45
- data/sig/herb/engine/validator.rbs +0 -41
- data/sig/herb_c_extension.rbs +0 -10
- data/sig/vendor/did_you_mean.rbs +0 -6
- 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
|
|
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*
|
|
73
|
-
|
|
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*
|
|
112
|
-
|
|
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*
|
|
145
|
-
|
|
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*
|
|
183
|
-
|
|
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*
|
|
224
|
-
|
|
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*
|
|
272
|
-
|
|
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*
|
|
305
|
-
|
|
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*
|
|
343
|
-
|
|
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*
|
|
374
|
-
|
|
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*
|
|
405
|
-
|
|
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*
|
|
421
|
-
|
|
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*
|
|
437
|
-
|
|
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*
|
|
466
|
-
|
|
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*
|
|
517
|
-
|
|
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*
|
|
550
|
-
|
|
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*
|
|
591
|
-
|
|
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*
|
|
624
|
-
|
|
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*
|
|
657
|
-
|
|
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*
|
|
690
|
-
|
|
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*
|
|
723
|
-
|
|
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*
|
|
756
|
-
|
|
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*
|
|
783
|
-
|
|
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*
|
|
820
|
-
|
|
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*
|
|
856
|
-
|
|
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*
|
|
898
|
-
|
|
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*
|
|
914
|
-
|
|
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*
|
|
951
|
-
|
|
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*
|
|
982
|
-
|
|
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*
|
|
998
|
-
|
|
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*
|
|
1029
|
-
|
|
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*
|
|
1065
|
-
|
|
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*
|
|
1096
|
-
|
|
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*
|
|
1127
|
-
|
|
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*
|
|
1158
|
-
|
|
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
|
|
1782
|
+
return herb_state_duplicate_declaration_error;
|
|
1171
1783
|
}
|
|
1172
1784
|
|
|
1173
|
-
void
|
|
1174
|
-
|
|
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*
|
|
1217
|
-
|
|
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*
|
|
1248
|
-
|
|
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
|
|
1349
|
-
if (unexpected_error->expected
|
|
1350
|
-
if (unexpected_error->found
|
|
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
|
|
1384
|
-
if (void_element_closing_tag_error->found
|
|
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
|
|
1397
|
-
if (ruby_parse_error->diagnostic_id
|
|
1398
|
-
if (ruby_parse_error->level
|
|
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
|
|
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
|
|
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
|
|
1436
|
-
if (conditional_element_condition_mismatch_error->open_condition
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1511
|
-
if (render_missing_locals_error->keywords
|
|
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
|
|
1524
|
-
if (render_conflicting_partial_error->keyword_partial
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
1580
|
-
if (void_element_content_error->content_type
|
|
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
|
|