Word Unperfect
public
Read
Owner: themaster
Branch: main
Commits: 0
Git CLI clone URL
git clone https://www.xt-emporium.com/git/word-unperfect.git
Fullscreen desktop URL
Code
Commits
History
Branches
Bug Reports
Discussions
Compare
Settings
word-unperfect
/
rev
/
wp_parser_classify.h
File editor
#ifndef WP_PARSER_CLASSIFY_H #define WP_PARSER_CLASSIFY_H #include "wp_file_format.h" #include "wp_layout_shared.h" #include "wp_record_parser.h" #include <stdbool.h> #include <stddef.h> #include <stdint.h> /* Host-safe port of parser_classify_or_handle_token @ 1000:2447. * * The original routine is a branch-heavy parser/backtracking helper that * prepends the current token, adjusts cursor/span counters, routes low-control * and format tokens through layout-state side effects, and jumps to several * near-code labels (0x79FA, 0x7B6F, 0x7B91). This module preserves the * observable classification and state effects without jumping through raw * decompiler addresses. */ typedef enum WpParserClassifyRoute { WP_PARSER_CLASSIFY_ROUTE_NONE = 0, WP_PARSER_CLASSIFY_ROUTE_SPACE_BACKTRACK, WP_PARSER_CLASSIFY_ROUTE_PRINTABLE_BACKTRACK, WP_PARSER_CLASSIFY_ROUTE_C0_EXTENDED_REPLAY, WP_PARSER_CLASSIFY_ROUTE_LOW_CONTROL_RESTORE, WP_PARSER_CLASSIFY_ROUTE_SINGLE_BYTE_CONTROL, WP_PARSER_CLASSIFY_ROUTE_FIXED_PACKET, WP_PARSER_CLASSIFY_ROUTE_VARIABLE_PACKET, WP_PARSER_CLASSIFY_ROUTE_DE_SCANNER_BYPASS, WP_PARSER_CLASSIFY_ROUTE_RANGE_CHECK_FALLBACK } WpParserClassifyRoute; typedef enum WpParserClassifyHandler { WP_PARSER_CLASSIFY_HANDLER_NONE = 0, WP_PARSER_CLASSIFY_HANDLER_79FA_TEXT_SINGLE = 0x79FA, WP_PARSER_CLASSIFY_HANDLER_7B6F_FIXED = 0x7B6F, WP_PARSER_CLASSIFY_HANDLER_7B91_VARIABLE = 0x7B91 } WpParserClassifyHandler; typedef struct WpParserClassifyStep { uint8_t code; uint8_t sub_code; WpCodeType record_type; WpParserClassifyRoute route; WpParserClassifyHandler handler; bool prepends_token; bool decrements_update_depth; bool decrements_processed_segments; bool clears_emit_bit1; bool cursor_decrement_stage1; bool cursor_decrement_stage2; bool c0_word_replay; bool parse_depth_pulse; bool runtime_bit0_set; bool state_update_gate_blocked_decrement; bool cursor_window_reset; bool low_control_restore_path; bool runtime_bit2_set; bool state_flags_cleared; bool status_extend_update; bool sub_metric_update; bool render_dirty_set; bool variant_balance_check; bool normalize_below_d0; bool reverse_transfer_hint; bool overlay_consume_hint; bool range_check; bool de_scanner_bypass; bool emit_flags_clear_0x14; bool record_wide_temp_snapshot; bool runtime_mismatch_dirty_possible; uint16_t consumed_record_bytes; uint16_t c0_payload_word; } WpParserClassifyStep; typedef struct WpParserClassifyStats { size_t records_seen; size_t bytes_consumed; size_t space_backtracks; size_t printable_backtracks; size_t c0_extended_replays; size_t c0_replayed_words; size_t deep_classifications; size_t low_control_restores; size_t single_byte_controls; size_t fixed_packets; size_t variable_packets; size_t de_scanner_bypass_packets; size_t range_check_fallbacks; size_t prepended_tokens; size_t update_depth_decrements; size_t processed_segment_decrements; size_t emit_bit1_clears; size_t cursor_stage1_decrements; size_t cursor_stage2_decrements; size_t parse_depth_pulses; size_t runtime_bit0_sets; size_t runtime_bit2_sets; size_t cursor_window_resets; size_t state_flags_clears; size_t status_extend_updates; size_t sub_metric_updates; size_t render_dirty_sets; size_t variant_balance_checks; size_t normalize_below_d0_calls; size_t reverse_transfer_hints; size_t overlay_consume_hints; size_t range_checks; size_t emit_flags_clear_0x14; size_t record_wide_temp_snapshots; size_t runtime_mismatch_dirty_hints; size_t handler_79fa_text_single; size_t handler_7b6f_fixed; size_t handler_7b91_variable; size_t incomplete_records; size_t mismatched_trailers; uint8_t final_runtime_flags; uint8_t final_emit_flags; uint8_t final_parse_depth_counter; int final_update_depth; int final_processed_segments; uint16_t final_cursor; uint16_t final_cursor_window; uint16_t final_span_aux; int final_record_aux; uint8_t final_state_flags; uint8_t final_render_dirty_flags; } WpParserClassifyStats; void wp_parser_classify_stats_clear(WpParserClassifyStats *stats); const char *wp_parser_classify_route_name(WpParserClassifyRoute route); const char *wp_parser_classify_handler_name(WpParserClassifyHandler handler); bool wp_parser_classify_plan_record(const WpLayoutGlobals *runtime, const WpRecord *rec, WpParserClassifyStep *out_step); void wp_parser_classify_apply_step(WpLayoutGlobals *runtime, const WpParserClassifyStep *step, WpParserClassifyStats *stats); bool wp_parser_classify_apply_record(WpLayoutGlobals *runtime, const WpRecord *rec, WpParserClassifyStats *stats); bool wp_parser_classify_run_stream(WpLayoutGlobals *wl, WpParserClassifyStats *stats); bool wp_parser_classify_run_loaded_file(WpLoadedFile *file, WpParserClassifyStats *stats); bool wp_parser_classify_run_file(const char *filename, WpParserClassifyStats *stats); #endif
Commit message
This repository is read-only for this account.
Repository snapshot
Current branch
main
Visibility
public
Your access
Read
Remote
None
File activity
View file history