herb 0.10.3 → 0.11.0
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 +16 -6
- 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 +1240 -790
- data/exe/herb +2 -0
- data/ext/herb/error_helpers.c +355 -17
- data/ext/herb/error_helpers.h +1 -1
- data/ext/herb/extconf.rb +4 -2
- data/ext/herb/extension.c +137 -89
- data/ext/herb/extension_helpers.c +81 -42
- data/ext/herb/extension_helpers.h +4 -1
- data/ext/herb/nodes.c +826 -358
- 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 +2 -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 +1342 -105
- data/lib/herb/backend.rb +73 -0
- data/lib/herb/bootstrap.rb +3 -7
- data/lib/herb/cli.rb +550 -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 +175 -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 +346 -108
- 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 +854 -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 +128 -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 +1326 -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 +2256 -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} +121 -93
- 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 -257
- data/lib/herb/ensure_installed.rb +43 -0
- data/lib/herb/errors.rb +646 -157
- 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 +65 -46
- data/lib/herb/position.rb +19 -0
- data/lib/herb/prism_inspect.rb +1 -4
- data/lib/herb/project.rb +31 -18
- 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 +662 -89
- data/sig/herb/backend.rbs +52 -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 +61 -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 +62 -23
- 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 +349 -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 +85 -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 +599 -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 +293 -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 +47 -21
- 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/serialized_ast_errors.rbs +58 -1
- data/sig/serialized_ast_nodes.rbs +58 -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 +57 -0
- data/src/analyze/action_view/tag_helpers.c +423 -93
- data/src/analyze/analyze.c +301 -64
- data/src/analyze/analyze_helpers.c +420 -23
- data/src/analyze/builders.c +79 -51
- data/src/analyze/conditional_elements.c +13 -8
- data/src/analyze/conditional_open_tags.c +11 -5
- data/src/analyze/control_type.c +16 -1
- 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 +13 -4
- data/src/analyze/render_nodes.c +345 -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 +911 -112
- data/src/ast/ast_pretty_print.c +161 -2
- 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 +1096 -128
- data/src/extract.c +30 -8
- data/src/herb.c +30 -11
- 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 -0
- data/src/include/analyze/builders.h +16 -0
- data/src/include/analyze/helpers.h +23 -2
- 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 +76 -2
- data/src/include/ast/ast_pretty_print.h +1 -1
- data/src/include/diff/herb_diff.h +11 -0
- data/src/include/errors.h +156 -39
- 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_peek_helpers.h +8 -1
- data/src/include/lexer/lexer_struct.h +4 -0
- data/src/include/lexer/token.h +3 -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_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 +16 -30
- data/src/include/parser/parser_helpers.h +13 -11
- data/src/include/parser/parser_options.h +41 -0
- 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 +83 -1
- data/src/lexer.c +196 -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 +606 -383
- data/src/parser_options_defaults.c +30 -0
- data/src/prism/prism_helpers.c +3 -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 +18 -13
- 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 +20 -16
- 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 +82 -19
- 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 +17 -12
- 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 +24 -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 +12 -12
- 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 +306 -27
- 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 -773
- 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/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) {
|
|
@@ -1103,43 +1576,178 @@ STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T* strict_locals_splat_argument_error_init(hb
|
|
|
1103
1576
|
|
|
1104
1577
|
error_init(&strict_locals_splat_argument_error->base, STRICT_LOCALS_SPLAT_ARGUMENT_ERROR, start, end);
|
|
1105
1578
|
|
|
1106
|
-
const char* message_template = "Strict locals only support keyword arguments. Splat argument `*%s` is not allowed.";
|
|
1579
|
+
const char* message_template = "Strict locals only support keyword arguments. Splat argument `*%s` is not allowed.";
|
|
1580
|
+
|
|
1581
|
+
hb_string_T truncated_argument_0 = hb_string_truncate(name, ERROR_MESSAGES_TRUNCATED_LENGTH);
|
|
1582
|
+
char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
|
|
1583
|
+
|
|
1584
|
+
char message[211];
|
|
1585
|
+
snprintf(
|
|
1586
|
+
message,
|
|
1587
|
+
sizeof(message),
|
|
1588
|
+
message_template,
|
|
1589
|
+
truncated_c_string_0 ? truncated_c_string_0 : ""
|
|
1590
|
+
);
|
|
1591
|
+
|
|
1592
|
+
if (truncated_c_string_0) { free(truncated_c_string_0); }
|
|
1593
|
+
strict_locals_splat_argument_error->base.message = hb_string_copy(hb_string(message), allocator);
|
|
1594
|
+
|
|
1595
|
+
strict_locals_splat_argument_error->name = hb_string_copy(name, allocator);
|
|
1596
|
+
return strict_locals_splat_argument_error;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
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);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
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) {
|
|
1608
|
+
STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_error = hb_allocator_alloc(allocator, sizeof(STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T));
|
|
1609
|
+
|
|
1610
|
+
if (!strict_locals_missing_parenthesis_error) { return NULL; }
|
|
1611
|
+
|
|
1612
|
+
error_init(&strict_locals_missing_parenthesis_error->base, STRICT_LOCALS_MISSING_PARENTHESIS_ERROR, start, end);
|
|
1613
|
+
|
|
1614
|
+
const char* message_template = "Strict locals declaration requires parentheses. Expected `locals: (...)` but got `locals: %s`.";
|
|
1615
|
+
|
|
1616
|
+
hb_string_T truncated_argument_0 = hb_string_truncate(rest, ERROR_MESSAGES_TRUNCATED_LENGTH);
|
|
1617
|
+
char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
|
|
1618
|
+
|
|
1619
|
+
char message[223];
|
|
1620
|
+
snprintf(
|
|
1621
|
+
message,
|
|
1622
|
+
sizeof(message),
|
|
1623
|
+
message_template,
|
|
1624
|
+
truncated_c_string_0 ? truncated_c_string_0 : ""
|
|
1625
|
+
);
|
|
1626
|
+
|
|
1627
|
+
if (truncated_c_string_0) { free(truncated_c_string_0); }
|
|
1628
|
+
strict_locals_missing_parenthesis_error->base.message = hb_string_copy(hb_string(message), allocator);
|
|
1629
|
+
|
|
1630
|
+
strict_locals_missing_parenthesis_error->rest = hb_string_copy(rest, allocator);
|
|
1631
|
+
return strict_locals_missing_parenthesis_error;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
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);
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T* strict_locals_duplicate_declaration_error_init(position_T start, position_T end, hb_allocator_T* allocator) {
|
|
1643
|
+
STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T* strict_locals_duplicate_declaration_error = hb_allocator_alloc(allocator, sizeof(STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR_T));
|
|
1644
|
+
|
|
1645
|
+
if (!strict_locals_duplicate_declaration_error) { return NULL; }
|
|
1646
|
+
|
|
1647
|
+
error_init(&strict_locals_duplicate_declaration_error->base, STRICT_LOCALS_DUPLICATE_DECLARATION_ERROR, start, end);
|
|
1648
|
+
|
|
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.";
|
|
1107
1705
|
|
|
1108
|
-
hb_string_T truncated_argument_0 = hb_string_truncate(
|
|
1706
|
+
hb_string_T truncated_argument_0 = hb_string_truncate(found, ERROR_MESSAGES_TRUNCATED_LENGTH);
|
|
1109
1707
|
char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
|
|
1110
1708
|
|
|
1111
|
-
|
|
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];
|
|
1112
1713
|
snprintf(
|
|
1113
1714
|
message,
|
|
1114
1715
|
sizeof(message),
|
|
1115
1716
|
message_template,
|
|
1116
|
-
truncated_c_string_0 ? truncated_c_string_0 : ""
|
|
1717
|
+
truncated_c_string_0 ? truncated_c_string_0 : "",
|
|
1718
|
+
truncated_c_string_1 ? truncated_c_string_1 : ""
|
|
1117
1719
|
);
|
|
1118
1720
|
|
|
1119
1721
|
if (truncated_c_string_0) { free(truncated_c_string_0); }
|
|
1120
|
-
|
|
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);
|
|
1121
1724
|
|
|
1122
|
-
|
|
1123
|
-
|
|
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;
|
|
1124
1728
|
}
|
|
1125
1729
|
|
|
1126
|
-
void
|
|
1127
|
-
|
|
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);
|
|
1128
1736
|
}
|
|
1129
1737
|
|
|
1130
|
-
|
|
1131
|
-
|
|
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));
|
|
1132
1740
|
|
|
1133
|
-
if (!
|
|
1741
|
+
if (!herb_state_invalid_parameter_error) { return NULL; }
|
|
1134
1742
|
|
|
1135
|
-
error_init(&
|
|
1743
|
+
error_init(&herb_state_invalid_parameter_error->base, HERB_STATE_INVALID_PARAMETER_ERROR, start, end);
|
|
1136
1744
|
|
|
1137
|
-
const char* message_template = "
|
|
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)`.";
|
|
1138
1746
|
|
|
1139
|
-
hb_string_T truncated_argument_0 = hb_string_truncate(
|
|
1747
|
+
hb_string_T truncated_argument_0 = hb_string_truncate(parameter, ERROR_MESSAGES_TRUNCATED_LENGTH);
|
|
1140
1748
|
char* truncated_c_string_0 = hb_string_to_c_string_using_malloc(truncated_argument_0);
|
|
1141
1749
|
|
|
1142
|
-
char message[
|
|
1750
|
+
char message[279];
|
|
1143
1751
|
snprintf(
|
|
1144
1752
|
message,
|
|
1145
1753
|
sizeof(message),
|
|
@@ -1148,30 +1756,38 @@ STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T* strict_locals_missing_parenthesis_err
|
|
|
1148
1756
|
);
|
|
1149
1757
|
|
|
1150
1758
|
if (truncated_c_string_0) { free(truncated_c_string_0); }
|
|
1151
|
-
|
|
1759
|
+
herb_state_invalid_parameter_error->base.message = hb_string_copy(hb_string(message), allocator);
|
|
1152
1760
|
|
|
1153
|
-
|
|
1154
|
-
return
|
|
1761
|
+
herb_state_invalid_parameter_error->parameter = hb_string_copy(parameter, allocator);
|
|
1762
|
+
return herb_state_invalid_parameter_error;
|
|
1155
1763
|
}
|
|
1156
1764
|
|
|
1157
|
-
void
|
|
1158
|
-
|
|
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);
|
|
1159
1771
|
}
|
|
1160
1772
|
|
|
1161
|
-
|
|
1162
|
-
|
|
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));
|
|
1163
1775
|
|
|
1164
|
-
if (!
|
|
1776
|
+
if (!herb_state_duplicate_declaration_error) { return NULL; }
|
|
1165
1777
|
|
|
1166
|
-
error_init(&
|
|
1778
|
+
error_init(&herb_state_duplicate_declaration_error->base, HERB_STATE_DUPLICATE_DECLARATION_ERROR, start, end);
|
|
1167
1779
|
|
|
1168
|
-
|
|
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,12 @@ 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);
|
|
1249
1873
|
}
|
|
1250
1874
|
|
|
1251
1875
|
TIMEOUT_ERROR_T* timeout_error_init(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator) {
|
|
@@ -1271,8 +1895,12 @@ TIMEOUT_ERROR_T* timeout_error_init(size_t timeout_ms, position_T start, positio
|
|
|
1271
1895
|
return timeout_error;
|
|
1272
1896
|
}
|
|
1273
1897
|
|
|
1274
|
-
void append_timeout_error(size_t timeout_ms, position_T start, position_T end, hb_allocator_T* allocator, hb_array_T*
|
|
1275
|
-
|
|
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);
|
|
1276
1904
|
}
|
|
1277
1905
|
|
|
1278
1906
|
hb_string_T error_type_to_string(ERROR_T* error) {
|
|
@@ -1289,15 +1917,25 @@ hb_string_T error_type_to_string(ERROR_T* error) {
|
|
|
1289
1917
|
case MISSING_ERB_END_TAG_ERROR: return hb_string("MISSING_ERB_END_TAG_ERROR");
|
|
1290
1918
|
case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: return hb_string("ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR");
|
|
1291
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");
|
|
1292
1921
|
case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: return hb_string("CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR");
|
|
1293
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");
|
|
1294
1925
|
case INVALID_COMMENT_CLOSING_TAG_ERROR: return hb_string("INVALID_COMMENT_CLOSING_TAG_ERROR");
|
|
1295
1926
|
case OMITTED_CLOSING_TAG_ERROR: return hb_string("OMITTED_CLOSING_TAG_ERROR");
|
|
1296
1927
|
case UNCLOSED_OPEN_TAG_ERROR: return hb_string("UNCLOSED_OPEN_TAG_ERROR");
|
|
1297
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");
|
|
1298
1930
|
case UNCLOSED_QUOTE_ERROR: return hb_string("UNCLOSED_QUOTE_ERROR");
|
|
1299
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");
|
|
1300
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");
|
|
1301
1939
|
case STRAY_ERB_CLOSING_TAG_ERROR: return hb_string("STRAY_ERB_CLOSING_TAG_ERROR");
|
|
1302
1940
|
case NESTED_ERB_TAG_ERROR: return hb_string("NESTED_ERB_TAG_ERROR");
|
|
1303
1941
|
case RENDER_AMBIGUOUS_LOCALS_ERROR: return hb_string("RENDER_AMBIGUOUS_LOCALS_ERROR");
|
|
@@ -1312,6 +1950,10 @@ hb_string_T error_type_to_string(ERROR_T* error) {
|
|
|
1312
1950
|
case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: return hb_string("STRICT_LOCALS_SPLAT_ARGUMENT_ERROR");
|
|
1313
1951
|
case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: return hb_string("STRICT_LOCALS_MISSING_PARENTHESIS_ERROR");
|
|
1314
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");
|
|
1315
1957
|
case VOID_ELEMENT_CONTENT_ERROR: return hb_string("VOID_ELEMENT_CONTENT_ERROR");
|
|
1316
1958
|
case DOT_NOTATION_CASING_ERROR: return hb_string("DOT_NOTATION_CASING_ERROR");
|
|
1317
1959
|
case TIMEOUT_ERROR: return hb_string("TIMEOUT_ERROR");
|
|
@@ -1334,15 +1976,25 @@ hb_string_T error_human_type(ERROR_T* error) {
|
|
|
1334
1976
|
case MISSING_ERB_END_TAG_ERROR: return hb_string("MissingERBEndTagError");
|
|
1335
1977
|
case ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR: return hb_string("ERBMultipleBlocksInTagError");
|
|
1336
1978
|
case ERB_CASE_WITH_CONDITIONS_ERROR: return hb_string("ERBCaseWithConditionsError");
|
|
1979
|
+
case ERB_CASE_INLINE_PATTERN_MATCH_ERROR: return hb_string("ERBCaseInlinePatternMatchError");
|
|
1337
1980
|
case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: return hb_string("ConditionalElementMultipleTagsError");
|
|
1338
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");
|
|
1339
1984
|
case INVALID_COMMENT_CLOSING_TAG_ERROR: return hb_string("InvalidCommentClosingTagError");
|
|
1340
1985
|
case OMITTED_CLOSING_TAG_ERROR: return hb_string("OmittedClosingTagError");
|
|
1341
1986
|
case UNCLOSED_OPEN_TAG_ERROR: return hb_string("UnclosedOpenTagError");
|
|
1342
1987
|
case UNCLOSED_CLOSE_TAG_ERROR: return hb_string("UnclosedCloseTagError");
|
|
1988
|
+
case END_TAG_WITH_TRAILING_SOLIDUS_ERROR: return hb_string("EndTagWithTrailingSolidusError");
|
|
1343
1989
|
case UNCLOSED_QUOTE_ERROR: return hb_string("UnclosedQuoteError");
|
|
1344
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");
|
|
1345
1996
|
case UNCLOSED_ERB_TAG_ERROR: return hb_string("UnclosedERBTagError");
|
|
1997
|
+
case MALFORMED_ERB_CLOSING_TAG_ERROR: return hb_string("MalformedERBClosingTagError");
|
|
1346
1998
|
case STRAY_ERB_CLOSING_TAG_ERROR: return hb_string("StrayERBClosingTagError");
|
|
1347
1999
|
case NESTED_ERB_TAG_ERROR: return hb_string("NestedERBTagError");
|
|
1348
2000
|
case RENDER_AMBIGUOUS_LOCALS_ERROR: return hb_string("RenderAmbiguousLocalsError");
|
|
@@ -1357,6 +2009,10 @@ hb_string_T error_human_type(ERROR_T* error) {
|
|
|
1357
2009
|
case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: return hb_string("StrictLocalsSplatArgumentError");
|
|
1358
2010
|
case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: return hb_string("StrictLocalsMissingParenthesisError");
|
|
1359
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");
|
|
1360
2016
|
case VOID_ELEMENT_CONTENT_ERROR: return hb_string("VoidElementContentError");
|
|
1361
2017
|
case DOT_NOTATION_CASING_ERROR: return hb_string("DotNotationCasingError");
|
|
1362
2018
|
case TIMEOUT_ERROR: return hb_string("TimeoutError");
|
|
@@ -1374,9 +2030,9 @@ void error_free_base_error(ERROR_T* error, hb_allocator_T* allocator) {
|
|
|
1374
2030
|
}
|
|
1375
2031
|
|
|
1376
2032
|
static void error_free_unexpected_error(UNEXPECTED_ERROR_T* unexpected_error, hb_allocator_T* allocator) {
|
|
1377
|
-
if (unexpected_error->description
|
|
1378
|
-
if (unexpected_error->expected
|
|
1379
|
-
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); }
|
|
1380
2036
|
|
|
1381
2037
|
error_free_base_error(&unexpected_error->base, allocator);
|
|
1382
2038
|
}
|
|
@@ -1409,8 +2065,8 @@ static void error_free_tag_names_mismatch_error(TAG_NAMES_MISMATCH_ERROR_T* tag_
|
|
|
1409
2065
|
|
|
1410
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) {
|
|
1411
2067
|
if (void_element_closing_tag_error->tag_name != NULL) { token_free(void_element_closing_tag_error->tag_name, allocator); }
|
|
1412
|
-
if (void_element_closing_tag_error->expected
|
|
1413
|
-
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); }
|
|
1414
2070
|
|
|
1415
2071
|
error_free_base_error(&void_element_closing_tag_error->base, allocator);
|
|
1416
2072
|
}
|
|
@@ -1422,21 +2078,21 @@ static void error_free_unclosed_element_error(UNCLOSED_ELEMENT_ERROR_T* unclosed
|
|
|
1422
2078
|
}
|
|
1423
2079
|
|
|
1424
2080
|
static void error_free_ruby_parse_error(RUBY_PARSE_ERROR_T* ruby_parse_error, hb_allocator_T* allocator) {
|
|
1425
|
-
if (ruby_parse_error->error_message
|
|
1426
|
-
if (ruby_parse_error->diagnostic_id
|
|
1427
|
-
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); }
|
|
1428
2084
|
|
|
1429
2085
|
error_free_base_error(&ruby_parse_error->base, allocator);
|
|
1430
2086
|
}
|
|
1431
2087
|
|
|
1432
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) {
|
|
1433
|
-
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); }
|
|
1434
2090
|
|
|
1435
2091
|
error_free_base_error(&erb_control_flow_scope_error->base, allocator);
|
|
1436
2092
|
}
|
|
1437
2093
|
|
|
1438
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) {
|
|
1439
|
-
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); }
|
|
1440
2096
|
|
|
1441
2097
|
error_free_base_error(&missing_erb_end_tag_error->base, allocator);
|
|
1442
2098
|
}
|
|
@@ -1453,6 +2109,12 @@ static void error_free_erb_case_with_conditions_error(ERB_CASE_WITH_CONDITIONS_E
|
|
|
1453
2109
|
error_free_base_error(&erb_case_with_conditions_error->base, allocator);
|
|
1454
2110
|
}
|
|
1455
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
|
+
|
|
1456
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) {
|
|
1457
2119
|
// size_t is part of struct
|
|
1458
2120
|
// size_t is part of struct
|
|
@@ -1461,17 +2123,30 @@ static void error_free_conditional_element_multiple_tags_error(CONDITIONAL_ELEME
|
|
|
1461
2123
|
}
|
|
1462
2124
|
|
|
1463
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) {
|
|
1464
|
-
if (conditional_element_condition_mismatch_error->tag_name
|
|
1465
|
-
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); }
|
|
1466
2128
|
// size_t is part of struct
|
|
1467
2129
|
// size_t is part of struct
|
|
1468
|
-
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); }
|
|
1469
2131
|
// size_t is part of struct
|
|
1470
2132
|
// size_t is part of struct
|
|
1471
2133
|
|
|
1472
2134
|
error_free_base_error(&conditional_element_condition_mismatch_error->base, allocator);
|
|
1473
2135
|
}
|
|
1474
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
|
+
|
|
1475
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) {
|
|
1476
2151
|
if (invalid_comment_closing_tag_error->closing_tag != NULL) { token_free(invalid_comment_closing_tag_error->closing_tag, allocator); }
|
|
1477
2152
|
|
|
@@ -1497,6 +2172,12 @@ static void error_free_unclosed_close_tag_error(UNCLOSED_CLOSE_TAG_ERROR_T* uncl
|
|
|
1497
2172
|
error_free_base_error(&unclosed_close_tag_error->base, allocator);
|
|
1498
2173
|
}
|
|
1499
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
|
+
|
|
1500
2181
|
static void error_free_unclosed_quote_error(UNCLOSED_QUOTE_ERROR_T* unclosed_quote_error, hb_allocator_T* allocator) {
|
|
1501
2182
|
if (unclosed_quote_error->opening_quote != NULL) { token_free(unclosed_quote_error->opening_quote, allocator); }
|
|
1502
2183
|
|
|
@@ -1504,17 +2185,54 @@ static void error_free_unclosed_quote_error(UNCLOSED_QUOTE_ERROR_T* unclosed_quo
|
|
|
1504
2185
|
}
|
|
1505
2186
|
|
|
1506
2187
|
static void error_free_missing_attribute_value_error(MISSING_ATTRIBUTE_VALUE_ERROR_T* missing_attribute_value_error, hb_allocator_T* allocator) {
|
|
1507
|
-
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); }
|
|
1508
2189
|
|
|
1509
2190
|
error_free_base_error(&missing_attribute_value_error->base, allocator);
|
|
1510
2191
|
}
|
|
1511
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
|
+
|
|
1512
2223
|
static void error_free_unclosed_erb_tag_error(UNCLOSED_ERB_TAG_ERROR_T* unclosed_erb_tag_error, hb_allocator_T* allocator) {
|
|
1513
2224
|
if (unclosed_erb_tag_error->opening_tag != NULL) { token_free(unclosed_erb_tag_error->opening_tag, allocator); }
|
|
1514
2225
|
|
|
1515
2226
|
error_free_base_error(&unclosed_erb_tag_error->base, allocator);
|
|
1516
2227
|
}
|
|
1517
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
|
+
|
|
1518
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) {
|
|
1519
2237
|
/* no STRAY_ERB_CLOSING_TAG_ERROR_T specific fields to free up */
|
|
1520
2238
|
|
|
@@ -1530,14 +2248,14 @@ static void error_free_nested_erb_tag_error(NESTED_ERB_TAG_ERROR_T* nested_erb_t
|
|
|
1530
2248
|
}
|
|
1531
2249
|
|
|
1532
2250
|
static void error_free_render_ambiguous_locals_error(RENDER_AMBIGUOUS_LOCALS_ERROR_T* render_ambiguous_locals_error, hb_allocator_T* allocator) {
|
|
1533
|
-
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); }
|
|
1534
2252
|
|
|
1535
2253
|
error_free_base_error(&render_ambiguous_locals_error->base, allocator);
|
|
1536
2254
|
}
|
|
1537
2255
|
|
|
1538
2256
|
static void error_free_render_missing_locals_error(RENDER_MISSING_LOCALS_ERROR_T* render_missing_locals_error, hb_allocator_T* allocator) {
|
|
1539
|
-
if (render_missing_locals_error->partial
|
|
1540
|
-
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); }
|
|
1541
2259
|
|
|
1542
2260
|
error_free_base_error(&render_missing_locals_error->base, allocator);
|
|
1543
2261
|
}
|
|
@@ -1549,14 +2267,14 @@ static void error_free_render_no_arguments_error(RENDER_NO_ARGUMENTS_ERROR_T* re
|
|
|
1549
2267
|
}
|
|
1550
2268
|
|
|
1551
2269
|
static void error_free_render_conflicting_partial_error(RENDER_CONFLICTING_PARTIAL_ERROR_T* render_conflicting_partial_error, hb_allocator_T* allocator) {
|
|
1552
|
-
if (render_conflicting_partial_error->positional_partial
|
|
1553
|
-
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); }
|
|
1554
2272
|
|
|
1555
2273
|
error_free_base_error(&render_conflicting_partial_error->base, allocator);
|
|
1556
2274
|
}
|
|
1557
2275
|
|
|
1558
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) {
|
|
1559
|
-
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); }
|
|
1560
2278
|
|
|
1561
2279
|
error_free_base_error(&render_invalid_as_option_error->base, allocator);
|
|
1562
2280
|
}
|
|
@@ -1568,31 +2286,31 @@ static void error_free_render_object_and_collection_error(RENDER_OBJECT_AND_COLL
|
|
|
1568
2286
|
}
|
|
1569
2287
|
|
|
1570
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) {
|
|
1571
|
-
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); }
|
|
1572
2290
|
|
|
1573
2291
|
error_free_base_error(&render_layout_without_block_error->base, allocator);
|
|
1574
2292
|
}
|
|
1575
2293
|
|
|
1576
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) {
|
|
1577
|
-
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); }
|
|
1578
2296
|
|
|
1579
2297
|
error_free_base_error(&strict_locals_positional_argument_error->base, allocator);
|
|
1580
2298
|
}
|
|
1581
2299
|
|
|
1582
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) {
|
|
1583
|
-
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); }
|
|
1584
2302
|
|
|
1585
2303
|
error_free_base_error(&strict_locals_block_argument_error->base, allocator);
|
|
1586
2304
|
}
|
|
1587
2305
|
|
|
1588
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) {
|
|
1589
|
-
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); }
|
|
1590
2308
|
|
|
1591
2309
|
error_free_base_error(&strict_locals_splat_argument_error->base, allocator);
|
|
1592
2310
|
}
|
|
1593
2311
|
|
|
1594
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) {
|
|
1595
|
-
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); }
|
|
1596
2314
|
|
|
1597
2315
|
error_free_base_error(&strict_locals_missing_parenthesis_error->base, allocator);
|
|
1598
2316
|
}
|
|
@@ -1603,10 +2321,35 @@ static void error_free_strict_locals_duplicate_declaration_error(STRICT_LOCALS_D
|
|
|
1603
2321
|
error_free_base_error(&strict_locals_duplicate_declaration_error->base, allocator);
|
|
1604
2322
|
}
|
|
1605
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
|
+
|
|
1606
2349
|
static void error_free_void_element_content_error(VOID_ELEMENT_CONTENT_ERROR_T* void_element_content_error, hb_allocator_T* allocator) {
|
|
1607
2350
|
if (void_element_content_error->tag_name != NULL) { token_free(void_element_content_error->tag_name, allocator); }
|
|
1608
|
-
if (void_element_content_error->helper_name
|
|
1609
|
-
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); }
|
|
1610
2353
|
|
|
1611
2354
|
error_free_base_error(&void_element_content_error->base, allocator);
|
|
1612
2355
|
}
|
|
@@ -1639,15 +2382,25 @@ void error_free(ERROR_T* error, hb_allocator_T* allocator) {
|
|
|
1639
2382
|
case MISSING_ERB_END_TAG_ERROR: error_free_missing_erb_end_tag_error((MISSING_ERB_END_TAG_ERROR_T*) error, allocator); break;
|
|
1640
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;
|
|
1641
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;
|
|
1642
2386
|
case CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR: error_free_conditional_element_multiple_tags_error((CONDITIONAL_ELEMENT_MULTIPLE_TAGS_ERROR_T*) error, allocator); break;
|
|
1643
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;
|
|
1644
2390
|
case INVALID_COMMENT_CLOSING_TAG_ERROR: error_free_invalid_comment_closing_tag_error((INVALID_COMMENT_CLOSING_TAG_ERROR_T*) error, allocator); break;
|
|
1645
2391
|
case OMITTED_CLOSING_TAG_ERROR: error_free_omitted_closing_tag_error((OMITTED_CLOSING_TAG_ERROR_T*) error, allocator); break;
|
|
1646
2392
|
case UNCLOSED_OPEN_TAG_ERROR: error_free_unclosed_open_tag_error((UNCLOSED_OPEN_TAG_ERROR_T*) error, allocator); break;
|
|
1647
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;
|
|
1648
2395
|
case UNCLOSED_QUOTE_ERROR: error_free_unclosed_quote_error((UNCLOSED_QUOTE_ERROR_T*) error, allocator); break;
|
|
1649
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;
|
|
1650
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;
|
|
1651
2404
|
case STRAY_ERB_CLOSING_TAG_ERROR: error_free_stray_erb_closing_tag_error((STRAY_ERB_CLOSING_TAG_ERROR_T*) error, allocator); break;
|
|
1652
2405
|
case NESTED_ERB_TAG_ERROR: error_free_nested_erb_tag_error((NESTED_ERB_TAG_ERROR_T*) error, allocator); break;
|
|
1653
2406
|
case RENDER_AMBIGUOUS_LOCALS_ERROR: error_free_render_ambiguous_locals_error((RENDER_AMBIGUOUS_LOCALS_ERROR_T*) error, allocator); break;
|
|
@@ -1662,6 +2415,10 @@ void error_free(ERROR_T* error, hb_allocator_T* allocator) {
|
|
|
1662
2415
|
case STRICT_LOCALS_SPLAT_ARGUMENT_ERROR: error_free_strict_locals_splat_argument_error((STRICT_LOCALS_SPLAT_ARGUMENT_ERROR_T*) error, allocator); break;
|
|
1663
2416
|
case STRICT_LOCALS_MISSING_PARENTHESIS_ERROR: error_free_strict_locals_missing_parenthesis_error((STRICT_LOCALS_MISSING_PARENTHESIS_ERROR_T*) error, allocator); break;
|
|
1664
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;
|
|
1665
2422
|
case VOID_ELEMENT_CONTENT_ERROR: error_free_void_element_content_error((VOID_ELEMENT_CONTENT_ERROR_T*) error, allocator); break;
|
|
1666
2423
|
case DOT_NOTATION_CASING_ERROR: error_free_dot_notation_casing_error((DOT_NOTATION_CASING_ERROR_T*) error, allocator); break;
|
|
1667
2424
|
case TIMEOUT_ERROR: error_free_timeout_error((TIMEOUT_ERROR_T*) error, allocator); break;
|
|
@@ -1888,6 +2645,19 @@ static void error_pretty_print_erb_case_with_conditions_error(ERB_CASE_WITH_COND
|
|
|
1888
2645
|
pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
|
|
1889
2646
|
}
|
|
1890
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
|
+
|
|
1891
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) {
|
|
1892
2662
|
if (!error) { return; }
|
|
1893
2663
|
|
|
@@ -1923,6 +2693,35 @@ static void error_pretty_print_conditional_element_condition_mismatch_error(COND
|
|
|
1923
2693
|
pretty_print_size_t_property(error->close_column, hb_string("close_column"), indent, relative_indent, true, buffer);
|
|
1924
2694
|
}
|
|
1925
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
|
+
|
|
1926
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) {
|
|
1927
2726
|
if (!error) { return; }
|
|
1928
2727
|
|
|
@@ -1980,6 +2779,20 @@ static void error_pretty_print_unclosed_close_tag_error(UNCLOSED_CLOSE_TAG_ERROR
|
|
|
1980
2779
|
pretty_print_token_property(error->tag_name, hb_string("tag_name"), indent, relative_indent, true, buffer);
|
|
1981
2780
|
}
|
|
1982
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
|
+
|
|
1983
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) {
|
|
1984
2797
|
if (!error) { return; }
|
|
1985
2798
|
|
|
@@ -2008,6 +2821,76 @@ static void error_pretty_print_missing_attribute_value_error(MISSING_ATTRIBUTE_V
|
|
|
2008
2821
|
pretty_print_quoted_property(hb_string("attribute_name"), error->attribute_name, indent, relative_indent, true, buffer);
|
|
2009
2822
|
}
|
|
2010
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
|
+
|
|
2011
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) {
|
|
2012
2895
|
if (!error) { return; }
|
|
2013
2896
|
|
|
@@ -2022,6 +2905,21 @@ static void error_pretty_print_unclosed_erb_tag_error(UNCLOSED_ERB_TAG_ERROR_T*
|
|
|
2022
2905
|
pretty_print_token_property(error->opening_tag, hb_string("opening_tag"), indent, relative_indent, true, buffer);
|
|
2023
2906
|
}
|
|
2024
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
|
+
|
|
2025
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) {
|
|
2026
2924
|
if (!error) { return; }
|
|
2027
2925
|
|
|
@@ -2218,6 +3116,62 @@ static void error_pretty_print_strict_locals_duplicate_declaration_error(STRICT_
|
|
|
2218
3116
|
pretty_print_quoted_property(hb_string("message"), error->base.message, indent, relative_indent, true, buffer);
|
|
2219
3117
|
}
|
|
2220
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
|
+
|
|
2221
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) {
|
|
2222
3176
|
if (!error) { return; }
|
|
2223
3177
|
|
|
@@ -2278,15 +3232,25 @@ void error_pretty_print(ERROR_T* error, const size_t indent, const size_t relati
|
|
|
2278
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;
|
|
2279
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;
|
|
2280
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;
|
|
2281
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;
|
|
2282
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;
|
|
2283
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;
|
|
2284
3241
|
case OMITTED_CLOSING_TAG_ERROR: error_pretty_print_omitted_closing_tag_error((OMITTED_CLOSING_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2285
3242
|
case UNCLOSED_OPEN_TAG_ERROR: error_pretty_print_unclosed_open_tag_error((UNCLOSED_OPEN_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2286
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;
|
|
2287
3245
|
case UNCLOSED_QUOTE_ERROR: error_pretty_print_unclosed_quote_error((UNCLOSED_QUOTE_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2288
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;
|
|
2289
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;
|
|
2290
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;
|
|
2291
3255
|
case NESTED_ERB_TAG_ERROR: error_pretty_print_nested_erb_tag_error((NESTED_ERB_TAG_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2292
3256
|
case RENDER_AMBIGUOUS_LOCALS_ERROR: error_pretty_print_render_ambiguous_locals_error((RENDER_AMBIGUOUS_LOCALS_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
@@ -2301,6 +3265,10 @@ void error_pretty_print(ERROR_T* error, const size_t indent, const size_t relati
|
|
|
2301
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;
|
|
2302
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;
|
|
2303
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;
|
|
2304
3272
|
case VOID_ELEMENT_CONTENT_ERROR: error_pretty_print_void_element_content_error((VOID_ELEMENT_CONTENT_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2305
3273
|
case DOT_NOTATION_CASING_ERROR: error_pretty_print_dot_notation_casing_error((DOT_NOTATION_CASING_ERROR_T*) error, indent, relative_indent, buffer); break;
|
|
2306
3274
|
case TIMEOUT_ERROR: error_pretty_print_timeout_error((TIMEOUT_ERROR_T*) error, indent, relative_indent, buffer); break;
|