%%
%% This is file `unravel.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% unravel.dtx  (with options: `package')
%% 
%% Do not distribute a modified version of this file.
%% 
%% Communicate any suggestions for changing this package
%% to Bruno Le Floch (blflatex+unravel@gmail.com).
%% 
%% File: unravel.dtx Copyright (C) 2013, 2015, 2018 Bruno Le Floch
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% -----------------------------------------------------------------------
\begingroup\let\c\catcode\fam32\c\fam10\advance\fam5\c\fam14\c45 12 %
\c54 12\c55 12\c56 12\c57 12\c58 11\c95 11\c104 11\c106 11\c107 11 %
\c113 11\c115 11\c119 11\c120 11\c121 11\c122 11\endlinechar-1 %
\expandafter\ifx\csname unravel\endcsname\relax
\else\endinput\expandafter\endgroup\fi
\c84 11\c88 11\c35 6\c123 1\c125 2\c62 12\c61 12\c43 12 %
\expandafter\ifx\csname numexpr\endcsname\relax
\errmessage{unravel requires \numexpr from eTeX}
\endinput\expandafter\endgroup\fi
\expandafter\ifx\csname protected\endcsname\relax
\errmessage{unravel requires \protected from eTeX}
\endinput\expandafter\endgroup\fi
\expandafter\ifx\csname currentgrouplevel\endcsname\relax\else
\ifnum\currentgrouplevel>1 \errmessage{unravel loaded in a group}
\endinput\expandafter\expandafter\expandafter\endgroup\fi\fi
\catcode 32 = 9 \relax
\catcode 126 = 10 \relax
\gdef \l__unravel_setup_restore_tl { }
\protected \gdef \__unravel_setup_restore:
  {
    \l__unravel_setup_restore_tl
    \def \l__unravel_setup_restore_tl { }
  }
\protected \gdef \__unravel_setup_save:
  {
    \edef \l__unravel_setup_restore_tl
      {
        \__unravel_setup_save_aux:w 0 =
        \endlinechar = \the \endlinechar
        \escapechar = \the \escapechar
        \newlinechar = \the \newlinechar
        \relax
      }
  }
\long \gdef \__unravel_setup_save_aux:w #1 =
  {
    \catcode #1 = \the \catcode #1 ~
    \ifnum 255 > #1 ~
      \expandafter \__unravel_setup_save_aux:w
      \the \numexpr #1 + 1 \expandafter =
    \fi
  }
\protected \long \gdef \__unravel_setup_catcodes:nnn #1 #2 #3
  {
    \ifnum #1 > #2 ~ \else
      \catcode #1 = #3 ~
      \expandafter \__unravel_setup_catcodes:nnn \expandafter
        { \the \numexpr #1 + 1 } {#2} {#3}
    \fi
  }
\protected \gdef \__unravel_setup_latexe:
  {
    \__unravel_setup_save:
    \__unravel_setup_catcodes:nnn {0} {8} {15}
    \catcode 9 = 10 ~
    \catcode 10 = 12 ~
    \catcode 11 = 15 ~
    \catcode 12 = 13 ~
    \catcode 13 = 5 ~
    \__unravel_setup_catcodes:nnn {14} {31} {15}
    \catcode 32 = 10 ~
    \catcode 33 = 12 ~
    \catcode 34 = 12 ~
    \catcode 35 = 6 ~
    \catcode 36 = 3 ~
    \catcode 37 = 14 ~
    \catcode 38 = 4 ~
    \__unravel_setup_catcodes:nnn {39} {63} {12}
    \__unravel_setup_catcodes:nnn {64} {90} {11}
    \catcode 91 = 12 ~
    \catcode 92 = 0 ~
    \catcode 93 = 12 ~
    \catcode 94 = 7 ~
    \catcode 95 = 8 ~
    \catcode 96 = 12 ~
    \__unravel_setup_catcodes:nnn {97} {122} {11}
    \catcode 123 = 1 ~
    \catcode 124 = 12 ~
    \catcode 125 = 2 ~
    \catcode 126 = 13 ~
    \catcode 127 = 15 ~
    \__unravel_setup_catcodes:nnn {128} {255} {12}
    \endlinechar = 13 ~
    \escapechar = 92 ~
    \newlinechar = 10 ~
  }
\protected \gdef \__unravel_setup_unravel:
  {
    \__unravel_setup_save:
    \__unravel_setup_catcodes:nnn {0} {8} {15}
    \catcode 9 = 9 ~
    \catcode 10 = 12 ~
    \catcode 11 = 15 ~
    \catcode 12 = 13 ~
    \catcode 13 = 5 ~
    \__unravel_setup_catcodes:nnn {14} {31} {15}
    \catcode 32 = 9 ~
    \catcode 33 = 12 ~
    \catcode 34 = 12 ~
    \catcode 35 = 6 ~
    \catcode 36 = 3 ~
    \catcode 37 = 14 ~
    \catcode 38 = 4 ~
    \__unravel_setup_catcodes:nnn {39} {57} {12}
    \catcode 58 = 11 ~
    \__unravel_setup_catcodes:nnn {59} {64} {12}
    \__unravel_setup_catcodes:nnn {65} {90} {11}
    \catcode 91 = 12 ~
    \catcode 92 = 0 ~
    \catcode 93 = 12 ~
    \catcode 94 = 7 ~
    \catcode 95 = 11 ~
    \catcode 96 = 12 ~
    \__unravel_setup_catcodes:nnn {97} {122} {11}
    \catcode 123 = 1 ~
    \catcode 124 = 12 ~
    \catcode 125 = 2 ~
    \catcode 126 = 10 ~
    \catcode 127 = 15 ~
    \__unravel_setup_catcodes:nnn {128} {255} {12}
    \escapechar  = 92 ~
    \endlinechar  = 32 ~
    \newlinechar  = 10 ~
  }
\expandafter \endgroup \__unravel_setup_latexe:
\RequirePackage{expl3,xparse}[2018/02/21]
\RequirePackage{gtl}[2018/12/28]
\csname cs_if_exist:cF\endcsname{str_range:nnn}{\RequirePackage{l3str}}
\csname use:n\endcsname
  {%
    \csname __unravel_setup_restore:\endcsname
    \ProvidesExplPackage
      {unravel} {2018/12/28} {0.2f} {Watching TeX digest tokens}%
    \csname __unravel_setup_unravel:\endcsname
  }%
\cs_new_eq:NN \__unravel_currentgrouptype:      \tex_currentgrouptype:D
\cs_new_protected:Npn \__unravel_set_escapechar:n
  { \int_set:Nn \tex_escapechar:D }
\cs_new_eq:NN \__unravel_everyeof:w             \tex_everyeof:D
\cs_new_eq:NN \__unravel_everypar:w             \tex_everypar:D
\cs_new_eq:NN \__unravel_hbox:w                 \tex_hbox:D
\cs_new_eq:NN \__unravel_mag:                   \tex_mag:D
\cs_new_eq:NN \__unravel_nullfont:              \tex_nullfont:D
\cs_new_eq:NN \__unravel_the:w                  \tex_the:D
\cs_new_eq:NN \__unravel_number:w               \tex_number:D
\exp_after:wN \cs_new_eq:NN
  \exp_after:wN \__unravel_special_relax:
  \exp_not:N \__unravel_special_relax:
\int_const:Nn \c__unravel_prompt_ior { 16 }
\int_const:Nn \c__unravel_noprompt_ior { -1 }
\cs_generate_variant:Nn \seq_push:Nn { Nf }
\cs_generate_variant:Nn \str_head:n { f }
\cs_generate_variant:Nn \tl_to_str:n { o }
\cs_generate_variant:Nn \tl_if_eq:nnTF { o }
\cs_generate_variant:Nn \tl_if_head_eq_meaning:nNT { V }
\cs_generate_variant:Nn \tl_if_single_token:nT { V }
\cs_generate_variant:Nn \gtl_gput_right:Nn { NV }
\cs_generate_variant:Nn \ior_str_get:NN { Nc }
\cs_generate_variant:Nn \gtl_if_empty:NTF { c }
\cs_generate_variant:Nn \gtl_to_str:N { c }
\cs_generate_variant:Nn \gtl_gpop_left:NN { c }
\cs_generate_variant:Nn \gtl_get_left:NN { c }
\cs_generate_variant:Nn \gtl_gset:Nn { c }
\cs_generate_variant:Nn \gtl_gconcat:NNN { ccc , cNc }
\cs_generate_variant:Nn \gtl_gclear:N { c }
\cs_generate_variant:Nn \gtl_gclear_new:N { c }
\cs_new_protected:Npn \__unravel_tl_if_in:ooTF #1#2#3#4
  {
    \group_begin:
    \exp_args:Noo \tl_if_in:nnTF {#1} {#2}
      { \group_end: #3 } { \group_end: #4 }
  }
\tl_new:N \l__unravel_exp_tl
\cs_new_protected:Npn \__unravel_exp_args:Nx #1#2
  {
    \cs_set_nopar:Npx \l__unravel_exp_tl { \exp_not:N #1 {#2} }
    \l__unravel_exp_tl
  }
\cs_new_protected:Npn \__unravel_exp_args:NNx #1#2#3
  {
    \cs_set_nopar:Npx \l__unravel_exp_tl { \exp_not:N #1 \exp_not:N #2 {#3} }
    \l__unravel_exp_tl
  }
\cs_new_protected:Npn \__unravel_tmp:w { }
\cs_set_protected:Npn \__unravel_tmp:w #1
  {
    \cs_new_protected:Npn \__unravel_file_get:nN ##1##2
      {
        \group_begin:
          \__unravel_everyeof:w { #1 ##2 }
          \exp_after:wN \__unravel_file_get_aux:wN
          \exp_after:wN \prg_do_nothing:
            \tex_input:D ##1 \scan_stop:
      }
    \cs_new_protected:Npn \__unravel_file_get_aux:wN ##1 #1 ##2
      {
        \group_end:
        \tl_set:Nx ##2
          { \exp_not:o {##1} \exp_not:V \__unravel_everyeof:w }
      }
  }
\exp_args:No \__unravel_tmp:w { \token_to_str:N : : }
\cs_new:Npn \__unravel_tl_first_int:N #1
  {
    \int_eval:n
      {
        \exp_after:wN \__unravel_tl_first_int_aux:Nn
        \exp_after:wN \__unravel_tl_first_int_aux:Nn
        #1 ? 0 ? \q_stop
      }
  }
\cs_new:Npn \__unravel_tl_first_int_aux:Nn #1#2
  {
    \tl_if_single:nT {#2}
      {
        \token_if_eq_catcode:NNT + #2
          {
            \if_int_compare:w 1 < 1 #2 \exp_stop_f:
              #2
              \exp_after:wN \use_i_ii:nnn
              \exp_after:wN \__unravel_tl_first_int_aux:Nn
              \exp_after:wN \use_none_delimit_by_q_stop:w
            \fi:
          }
      }
    #1
  }
\cs_new_protected:Npn \__unravel_prepare_mag:
  {
    \int_compare:nNnT { \g__unravel_mag_set_int } > { 0 }
      {
        \int_compare:nNnF { \__unravel_mag: } = { \g__unravel_mag_set_int }
          {
            \__unravel_tex_error:nn { incompatible-mag } { }
            \int_gset_eq:NN \__unravel_mag: \g__unravel_mag_set_int
          }
      }
    \int_compare:nF { 1 <= \__unravel_mag: <= 32768 }
      {
        \__unravel_tex_error:nV { illegal-mag } \l__unravel_head_tl
        \int_gset:Nn \__unravel_mag: { 1000 }
      }
    \int_gset_eq:NN \g__unravel_mag_set_int \__unravel_mag:
  }
\cs_new:Npn \__unravel_strip_escape:w
  {
    \tex_romannumeral:D
      \if_charcode:w \token_to_str:N \ \__unravel_strip_escape_aux:w \fi:
      \__unravel_strip_escape_aux:N
  }
\cs_new:Npn \__unravel_strip_escape_aux:N #1 { \c_zero_int }
\cs_new:Npn \__unravel_strip_escape_aux:w #1#2
  { - \__unravel_number:w #1 \c_zero_int }
\cs_new:Npn \__unravel_to_str:n #1
  {
    \tl_if_head_eq_meaning:nNTF {#1} \scan_stop:
      { \__unravel_to_str_auxi:w #1 ? \q_stop }
      { \tl_to_str:n }
    {#1}
  }
\cs_set:Npn \__unravel_tmp:w #1
  {
    \cs_new:Npn \__unravel_to_str_auxi:w ##1##2 \q_stop
      {
        \exp_after:wN \__unravel_to_str_auxii:w \token_to_str:N ##1 \q_mark
          #1 tl \q_mark \q_stop
      }
    \cs_new:Npn \__unravel_to_str_auxii:w ##1 #1 ##2 \q_mark ##3 \q_stop
      { \cs_if_exist_use:cF { __unravel_ ##2 _to_str:n } { \tl_to_str:n } }
  }
\exp_args:No \__unravel_tmp:w { \tl_to_str:n { s _ _ } }
\cs_new:Npn \__unravel_gtl_to_str:n { \gtl_to_str:n }
\cs_new:Npn \__unravel_str_truncate_left:nn #1#2
  {
    \exp_args:Nf \__unravel_str_truncate_left_aux:nnn
      { \str_count:n {#1} } {#1} {#2}
  }
\cs_new:Npn \__unravel_str_truncate_left_aux:nnn #1#2#3
  {
    \int_compare:nNnTF {#1} > {#3}
      {
        ( \int_eval:n { #1 - #3 + 25 } ~ more~chars ) ~
        \str_range:nnn {#2} { #1 - #3 + 26 } {#1}
      }
      { \tl_to_str:n {#2} }
  }
\cs_new:Npn \__unravel_str_truncate_right:nn #1#2
  {
    \exp_args:Nf \__unravel_str_truncate_right_aux:nnn
      { \str_count:n {#1} } {#1} {#2}
  }
\cs_new:Npn \__unravel_str_truncate_right_aux:nnn #1#2#3
  {
    \int_compare:nNnTF {#1} > {#3}
      {
        \str_range:nnn {#2} { 1 } { #3 - 25 } ~
        ( \int_eval:n { #1 - #3 + 25 } ~ more~chars )
      }
      { \tl_to_str:n {#2} }
  }
\cs_new_eq:NN \__unravel_exit_point: \prg_do_nothing:
\cs_new:Npn \__unravel_exit:w #1 \__unravel_exit_point: { }
\cs_new_eq:NN \__unravel_break_point: \prg_do_nothing:
\cs_new:Npn \__unravel_break:w #1 \__unravel_break_point: { }
\prg_new_conditional:Npnn \__unravel_cmd_if_internal: { TF }
  {
    \int_compare:nNnTF
      \l__unravel_head_cmd_int < { \__unravel_tex_use:n { min_internal } }
      { \prg_return_false: }
      {
        \int_compare:nNnTF
          \l__unravel_head_cmd_int
          > { \__unravel_tex_use:n { max_internal } }
          { \prg_return_false: }
          { \prg_return_true: }
      }
  }
\cs_new:Npn \__unravel_meaning_to_char:n #1
  { \__unravel_meaning_to_char_auxi:w #1 \q_mark ~ {} ~ \q_mark \q_stop }
\cs_new:Npn \__unravel_meaning_to_char_auxi:w #1 ~ #2 ~ #3 \q_mark #4 \q_stop
  { \__unravel_meaning_to_char_auxii:w #3 ~ #3 ~ \q_stop }
\cs_new:Npn \__unravel_meaning_to_char_auxii:w #1 ~ #2 ~ #3 \q_stop
  { \tl_if_empty:nTF {#2} { ~ } {#2} }
\cs_generate_variant:Nn \__unravel_meaning_to_char:n { o }
\cs_new:Npn \__unravel_token_to_char:N #1
  { \__unravel_meaning_to_char:o { \token_to_meaning:N #1 } }
\prg_new_conditional:Npnn \__unravel_token_if_expandable:N #1
  { p , T ,  F , TF }
  {
    \exp_after:wN \if_meaning:w \exp_not:N #1 #1
      \prg_return_false:
    \else:
      \prg_return_true:
    \fi:
  }
\prg_new_conditional:Npnn \__unravel_token_if_protected:N #1
  { p , T ,  F , TF }
  {
    \__unravel_token_if_expandable:NTF #1
      {
        \token_if_protected_macro:NTF #1
          { \prg_return_true: }
          {
            \token_if_protected_long_macro:NTF #1
              { \prg_return_true: }
              { \prg_return_false: }
          }
      }
      { \prg_return_true: }
  }
\group_begin:
  \char_set_catcode_active:n { `Z }
  \prg_new_protected_conditional:Npnn \__unravel_token_if_active_char:N #1
    { TF }
    {
      \group_begin:
        \__unravel_exp_args:Nx \char_set_lccode:nn
          { ` \exp_args:No \str_head:n { \token_to_str:N #1 } }
          { ` Z }
        \tex_lowercase:D { \tl_if_eq:nnTF {#1} } { Z }
          { \group_end: \prg_return_true: }
          { \group_end: \prg_return_false: }
    }
\group_end:
\group_begin:
  \char_set_catcode_active:n { `Z }
  \prg_new_protected_conditional:Npnn \__unravel_token_if_definable:N #1
    { TF }
    {
      \group_begin:
        \__unravel_set_escapechar:n { 92 }
        \tl_set:Nx \l__unravel_tmpa_tl
          { \exp_args:No \str_tail:n { \token_to_str:N #1 } }
        \tl_if_empty:NTF \l__unravel_tmpa_tl
          {
            \__unravel_token_if_active_char:NTF #1
              { \group_end: \prg_return_true: }
              { \group_end: \prg_return_false: }
          }
          { \group_end: \prg_return_true: }
    }
\group_end:
\prg_new_protected_conditional:Npnn \__unravel_gtl_if_head_is_definable:N #1
  { TF , F }
  {
    \gtl_if_single_token:NTF #1
      {
        \gtl_if_head_is_N_type:NTF #1
          {
            \gtl_head_do:NN #1 \__unravel_token_if_definable:NTF
              { \prg_return_true: }
              { \prg_return_false: }
          }
          { \prg_return_false: }
      }
      { \prg_return_false: }
  }
\cs_new:Npn \__unravel_prev_input_count:
  {
    \int_eval:n
      {
        0
        \seq_map_function:NN \g__unravel_prev_input_seq
          \__unravel_prev_input_count_aux:n
      }
  }
\cs_new:Npn \__unravel_prev_input_count_aux:n #1
  { \tl_if_empty:nF {#1} { + 1 } }
\cs_new_protected:Npn \__unravel_prev_input_get:N
  { \seq_get_right:NN \g__unravel_prev_input_seq }
\cs_new_protected:Npn \__unravel_prev_input_gpush:
  { \seq_gput_right:Nn \g__unravel_prev_input_seq { } }
\cs_new_protected:Npn \__unravel_prev_input_gpush:N
  { \seq_gput_right:NV \g__unravel_prev_input_seq }
\cs_new_protected:Npn \__unravel_prev_input_gpop:N
  { \seq_gpop_right:NN \g__unravel_prev_input_seq }
\cs_new_protected:Npn \__unravel_prev_input_gpush_gtl:
  { \seq_gput_right:NV \g__unravel_prev_input_seq \c_empty_gtl }
\cs_new_protected:Npn \__unravel_prev_input_gpush_gtl:N
  { \seq_gput_right:NV \g__unravel_prev_input_seq }
\cs_new_protected:Npn \__unravel_prev_input_gpop_gtl:N
  { \seq_gpop_right:NN \g__unravel_prev_input_seq }
\cs_new_protected:Npn \__unravel_prev_input_silent:n #1
  {
    \__unravel_prev_input_gpop:N \l__unravel_prev_input_tl
    \tl_put_right:Nn \l__unravel_prev_input_tl {#1}
    \__unravel_prev_input_gpush:N \l__unravel_prev_input_tl
  }
\cs_generate_variant:Nn \__unravel_prev_input_silent:n { V }
\cs_new_protected:Npn \__unravel_prev_input_silent:x
  { \__unravel_exp_args:Nx \__unravel_prev_input_silent:n }
\cs_new_protected:Npn \__unravel_prev_input:n #1
  {
    \__unravel_prev_input_silent:n {#1}
    \__unravel_print_action:x { \tl_to_str:n {#1} }
  }
\cs_generate_variant:Nn \__unravel_prev_input:n { V }
\cs_new_protected:Npn \__unravel_prev_input:x
  { \__unravel_exp_args:Nx \__unravel_prev_input:n }
\cs_new_protected:Npn \__unravel_prev_input_gtl:N #1
  {
    \__unravel_prev_input_gpop_gtl:N \l__unravel_prev_input_gtl
    \gtl_concat:NNN \l__unravel_prev_input_gtl \l__unravel_prev_input_gtl #1
    \__unravel_prev_input_gpush_gtl:N \l__unravel_prev_input_gtl
  }
\cs_new_protected:Npn \__unravel_prev_input_join_get:nN #1
  {
    \int_case:nnF {#1}
      {
        { 2 } { \__unravel_join_get_aux:NNN \skip_eval:n \tex_glueexpr:D }
        { 3 } { \__unravel_join_get_aux:NNN \muskip_eval:n \tex_muexpr:D }
      }
      {
        \__unravel_error:nnnnn { internal } { join-factor } { } { } { }
        \__unravel_join_get_aux:NNN \use:n \prg_do_nothing:
      }
  }
\cs_new_protected:Npn \__unravel_join_get_aux:NNN #1#2#3
  {
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \tl_set:Nx #3 { #1 { \l__unravel_tmpa_tl #2 \l__unravel_head_tl } }
  }
\tl_new:N \g__unravel_before_print_state_tl
\tl_new:N  \g__unravel_before_prompt_tl
\int_new:N \l__unravel_prompt_tmpa_int
\int_new:N \g__unravel_nonstop_int
\bool_new:N \g__unravel_default_explicit_prompt_bool
\bool_new:N \g__unravel_default_internal_debug_bool
\bool_new:N \g__unravel_default_number_steps_bool
\int_new:N  \g__unravel_default_online_int
\bool_new:N \g__unravel_default_trace_assigns_bool
\bool_new:N \g__unravel_default_trace_expansion_bool
\bool_new:N \g__unravel_default_trace_other_bool
\bool_new:N \g__unravel_default_welcome_message_bool
\bool_gset_true:N \g__unravel_default_number_steps_bool
\int_gset:Nn   \g__unravel_default_online_int { 1 }
\bool_gset_true:N \g__unravel_default_trace_assigns_bool
\bool_gset_true:N \g__unravel_default_trace_expansion_bool
\bool_gset_true:N \g__unravel_default_trace_other_bool
\bool_gset_true:N \g__unravel_default_welcome_message_bool
\bool_new:N \g__unravel_explicit_prompt_bool
\bool_new:N \g__unravel_internal_debug_bool
\bool_new:N \g__unravel_number_steps_bool
\int_new:N  \g__unravel_online_int
\bool_new:N \g__unravel_trace_assigns_bool
\bool_new:N \g__unravel_trace_expansion_bool
\bool_new:N \g__unravel_trace_other_bool
\bool_new:N \g__unravel_welcome_message_bool
\int_new:N \g__unravel_step_int
\str_new:N \g__unravel_action_text_str
\int_new:N \g__unravel_default_max_action_int
\int_new:N \g__unravel_default_max_output_int
\int_new:N \g__unravel_default_max_input_int
\int_gset:Nn \g__unravel_default_max_action_int { 50 }
\int_gset:Nn \g__unravel_default_max_output_int { 300 }
\int_gset:Nn \g__unravel_default_max_input_int { 300 }
\int_new:N \g__unravel_max_action_int
\int_new:N \g__unravel_max_output_int
\int_new:N \g__unravel_max_input_int
\bool_new:N \g__unravel_speedup_macros_bool
\bool_gset_true:N \g__unravel_speedup_macros_bool
\int_new:N \l__unravel_print_int
\int_new:N \g__unravel_input_int
\int_new:N \g__unravel_input_tmpa_int
\tl_new:N \l__unravel_input_tmpa_tl
\seq_new:N \g__unravel_prev_input_seq
\tl_new:N \l__unravel_prev_input_tl
\gtl_new:N \l__unravel_prev_input_gtl
\gtl_new:N \g__unravel_output_gtl
\gtl_new:N \l__unravel_head_gtl
\tl_new:N  \l__unravel_head_tl
\cs_new_eq:NN \l__unravel_head_token ?
\int_new:N \l__unravel_head_cmd_int
\int_new:N \l__unravel_head_char_int
\tl_new:N \l__unravel_head_meaning_tl
\tl_new:N \l__unravel_argi_tl
\tl_new:N \l__unravel_argii_tl
\tl_new:N \l__unravel_tmpa_tl
\gtl_new:N \l__unravel_unused_gtl
\gtl_new:N \l__unravel_tmpb_gtl
\tl_new:N \g__unravel_tmpc_tl
\seq_new:N \l__unravel_tmpa_seq
\cs_new_eq:NN \l__unravel_tmpb_token ?
\tl_new:N \l__unravel_defined_tl
\tl_new:N \l__unravel_defining_tl
\cs_new_eq:NN \__unravel_inaccessible:w ?
\gtl_new:N \g__unravel_after_assignment_gtl
\bool_new:N \g__unravel_set_box_allowed_bool
\bool_new:N \g__unravel_name_in_progress_bool
\gtl_new:N \l__unravel_after_group_gtl
\group_begin:
  \cs_set:Npx \__unravel_tmp:w #1 { \c_hash_str #1 }
  \tl_const:Nx \c__unravel_parameters_tl
    { ^ \tl_map_function:nN { 123456789 } \__unravel_tmp:w }
\group_end:
\int_new:N \g__unravel_val_level_int
\tl_new:N \g__unravel_if_limit_tl
\int_new:N \g__unravel_if_limit_int
\int_new:N \g__unravel_if_depth_int
\int_new:N \l__unravel_if_nesting_int
\seq_new:N \l__unravel_leaders_box_seq
\int_new:N \g__unravel_ends_int
\int_gset:Nn \g__unravel_ends_int { 3 }
\tl_const:Nn \c__unravel_plus_tl { + }
\tl_const:Nn \c__unravel_minus_tl { - }
\tl_const:Nn \c__unravel_times_tl { * }
\tl_const:Nn \c__unravel_over_tl { / }
\tl_const:Nn \c__unravel_lq_tl { ` }
\tl_const:Nn \c__unravel_rq_tl { ' }
\tl_const:Nn \c__unravel_dq_tl { " }
\tl_const:Nn \c__unravel_lp_tl { ( }
\tl_const:Nn \c__unravel_rp_tl { ) }
\tl_const:Nn \c__unravel_eq_tl { = }
\tl_const:Nn \c__unravel_comma_tl { , }
\tl_const:Nn \c__unravel_point_tl { . }
\gtl_const:Nx \c__unravel_frozen_relax_gtl { \if_int_compare:w 0 = 0 \fi: }
\int_new:N \g__unravel_mag_set_int
\cs_new_protected:Npn \__unravel_tex_const:nn #1#2
  { \int_const:cn { c__unravel_tex_#1_int } {#2} }
\cs_new:Npn \__unravel_tex_use:n #1 { \int_use:c { c__unravel_tex_#1_int } }
\cs_new_protected:Npn \__unravel_tex_primitive:nnn #1#2#3
  {
    \tl_const:cx { c__unravel_tex_#1_tl }
      { { \__unravel_tex_use:n {#2} } {#3} }
  }
\cs_new_protected:Npn \__unravel_new_tex_cmd:nn #1#2
  {
    \cs_new_protected:cpn
      { __unravel_cmd_ \__unravel_tex_use:n {#1} : } {#2}
  }
\cs_new_protected:Npn \__unravel_new_eq_tex_cmd:nn #1#2
  {
    \cs_new_eq:cc
      { __unravel_cmd_ \__unravel_tex_use:n {#1} : }
      { __unravel_cmd_ \__unravel_tex_use:n {#2} : }
  }
\cs_new_protected:Npn \__unravel_new_tex_expandable:nn #1#2
  {
    \cs_new_protected:cpn
      { __unravel_expandable_ \__unravel_tex_use:n {#1} : } {#2}
  }
\__unravel_tex_const:nn { relax                    } { 0 }
\__unravel_tex_const:nn { begin-group_char         } { 1 }
\__unravel_tex_const:nn { end-group_char           } { 2 }
\__unravel_tex_const:nn { math_char                } { 3 }
\__unravel_tex_const:nn { tab_mark                 } { 4 }
\__unravel_tex_const:nn { alignment_char           } { 4 }
\__unravel_tex_const:nn { car_ret                  } { 5 }
\__unravel_tex_const:nn { macro_char               } { 6 }
\__unravel_tex_const:nn { superscript_char         } { 7 }
\__unravel_tex_const:nn { subscript_char           } { 8 }
\__unravel_tex_const:nn { endv                     } { 9 }
\__unravel_tex_const:nn { blank_char               } { 10 }
\__unravel_tex_const:nn { the_char                 } { 11 }
\__unravel_tex_const:nn { other_char               } { 12 }
\__unravel_tex_const:nn { par_end                  } { 13 }
\__unravel_tex_const:nn { stop                     } { 14 }
\__unravel_tex_const:nn { delim_num                } { 15 }
\__unravel_tex_const:nn { max_char_code            } { 15 }
\__unravel_tex_const:nn { char_num                 } { 16 }
\__unravel_tex_const:nn { math_char_num            } { 17 }
\__unravel_tex_const:nn { mark                     } { 18 }
\__unravel_tex_const:nn { xray                     } { 19 }
\__unravel_tex_const:nn { make_box                 } { 20 }
\__unravel_tex_const:nn { hmove                    } { 21 }
\__unravel_tex_const:nn { vmove                    } { 22 }
\__unravel_tex_const:nn { un_hbox                  } { 23 }
\__unravel_tex_const:nn { un_vbox                  } { 24 }
\__unravel_tex_const:nn { remove_item              } { 25 }
\__unravel_tex_const:nn { hskip                    } { 26 }
\__unravel_tex_const:nn { vskip                    } { 27 }
\__unravel_tex_const:nn { mskip                    } { 28 }
\__unravel_tex_const:nn { kern                     } { 29 }
\__unravel_tex_const:nn { mkern                    } { 30 }
\__unravel_tex_const:nn { leader_ship              } { 31 }
\__unravel_tex_const:nn { halign                   } { 32 }
\__unravel_tex_const:nn { valign                   } { 33 }
\__unravel_tex_const:nn { no_align                 } { 34 }
\__unravel_tex_const:nn { vrule                    } { 35 }
\__unravel_tex_const:nn { hrule                    } { 36 }
\__unravel_tex_const:nn { insert                   } { 37 }
\__unravel_tex_const:nn { vadjust                  } { 38 }
\__unravel_tex_const:nn { ignore_spaces            } { 39 }
\__unravel_tex_const:nn { after_assignment         } { 40 }
\__unravel_tex_const:nn { after_group              } { 41 }
\__unravel_tex_const:nn { break_penalty            } { 42 }
\__unravel_tex_const:nn { start_par                } { 43 }
\__unravel_tex_const:nn { ital_corr                } { 44 }
\__unravel_tex_const:nn { accent                   } { 45 }
\__unravel_tex_const:nn { math_accent              } { 46 }
\__unravel_tex_const:nn { discretionary            } { 47 }
\__unravel_tex_const:nn { eq_no                    } { 48 }
\__unravel_tex_const:nn { left_right               } { 49 }
\__unravel_tex_const:nn { math_comp                } { 50 }
\__unravel_tex_const:nn { limit_switch             } { 51 }
\__unravel_tex_const:nn { above                    } { 52 }
\__unravel_tex_const:nn { math_style               } { 53 }
\__unravel_tex_const:nn { math_choice              } { 54 }
\__unravel_tex_const:nn { non_script               } { 55 }
\__unravel_tex_const:nn { vcenter                  } { 56 }
\__unravel_tex_const:nn { case_shift               } { 57 }
\__unravel_tex_const:nn { message                  } { 58 }
\__unravel_tex_const:nn { extension                } { 59 }
\__unravel_tex_const:nn { in_stream                } { 60 }
\__unravel_tex_const:nn { begin_group              } { 61 }
\__unravel_tex_const:nn { end_group                } { 62 }
\__unravel_tex_const:nn { omit                     } { 63 }
\__unravel_tex_const:nn { ex_space                 } { 64 }
\__unravel_tex_const:nn { no_boundary              } { 65 }
\__unravel_tex_const:nn { radical                  } { 66 }
\__unravel_tex_const:nn { end_cs_name              } { 67 }
\__unravel_tex_const:nn { min_internal             } { 68 }
\__unravel_tex_const:nn { char_given               } { 68 }
\__unravel_tex_const:nn { math_given               } { 69 }
\__unravel_tex_const:nn { last_item                } { 70 }
\__unravel_tex_const:nn { max_non_prefixed_command } { 70 }
\__unravel_tex_const:nn { toks_register            } { 71 }
\__unravel_tex_const:nn { assign_toks              } { 72 }
\__unravel_tex_const:nn { assign_int               } { 73 }
\__unravel_tex_const:nn { assign_dimen             } { 74 }
\__unravel_tex_const:nn { assign_glue              } { 75 }
\__unravel_tex_const:nn { assign_mu_glue           } { 76 }
\__unravel_tex_const:nn { assign_font_dimen        } { 77 }
\__unravel_tex_const:nn { assign_font_int          } { 78 }
\__unravel_tex_const:nn { set_aux                  } { 79 }
\__unravel_tex_const:nn { set_prev_graf            } { 80 }
\__unravel_tex_const:nn { set_page_dimen           } { 81 }
\__unravel_tex_const:nn { set_page_int             } { 82 }
\__unravel_tex_const:nn { set_box_dimen            } { 83 }
\__unravel_tex_const:nn { set_shape                } { 84 }
\__unravel_tex_const:nn { def_code                 } { 85 }
\__unravel_tex_const:nn { def_family               } { 86 }
\__unravel_tex_const:nn { set_font                 } { 87 }
\__unravel_tex_const:nn { def_font                 } { 88 }
\__unravel_tex_const:nn { register                 } { 89 }
\__unravel_tex_const:nn { max_internal             } { 89 }
\__unravel_tex_const:nn { advance                  } { 90 }
\__unravel_tex_const:nn { multiply                 } { 91 }
\__unravel_tex_const:nn { divide                   } { 92 }
\__unravel_tex_const:nn { prefix                   } { 93 }
\__unravel_tex_const:nn { let                      } { 94 }
\__unravel_tex_const:nn { shorthand_def            } { 95 }
\__unravel_tex_const:nn { read_to_cs               } { 96 }
\__unravel_tex_const:nn { def                      } { 97 }
\__unravel_tex_const:nn { set_box                  } { 98 }
\__unravel_tex_const:nn { hyph_data                } { 99 }
\__unravel_tex_const:nn { set_interaction          } { 100 }
\__unravel_tex_const:nn { letterspace_font         } { 101 }
\__unravel_tex_const:nn { pdf_copy_font            } { 102 }
\__unravel_tex_const:nn { max_command              } { 102 }
\__unravel_tex_const:nn { undefined_cs             } { 103 }
\__unravel_tex_const:nn { expand_after             } { 104 }
\__unravel_tex_const:nn { no_expand                } { 105 }
\__unravel_tex_const:nn { input                    } { 106 }
\__unravel_tex_const:nn { if_test                  } { 107 }
\__unravel_tex_const:nn { fi_or_else               } { 108 }
\__unravel_tex_const:nn { cs_name                  } { 109 }
\__unravel_tex_const:nn { convert                  } { 110 }
\__unravel_tex_const:nn { the                      } { 111 }
\__unravel_tex_const:nn { top_bot_mark             } { 112 }
\__unravel_tex_const:nn { call                     } { 113 }
\__unravel_tex_const:nn { end_template             } { 117 }
\sys_if_engine_luatex:T
  {
    \__unravel_tex_primitive:nnn
      { \exp_after:wN \use_none:n \token_to_meaning:N \__unravel_special_relax: }
      { relax } { 1 }
  }
\__unravel_tex_primitive:nnn { relax             } { relax    } { 256 }
\__unravel_tex_primitive:nnn { span              } { tab_mark } { 256 }
\__unravel_tex_primitive:nnn { cr                } { car_ret  } { 257 }
\__unravel_tex_primitive:nnn { crcr              } { car_ret  } { 258 }
\__unravel_tex_primitive:nnn { par               } { par_end  } { 256 }
\__unravel_tex_primitive:nnn { end               } { stop } { 0 }
\__unravel_tex_primitive:nnn { dump              } { stop } { 1 }
\__unravel_tex_primitive:nnn { delimiter         } { delim_num } { 0 }
\__unravel_tex_primitive:nnn { char              } { char_num } { 0 }
\__unravel_tex_primitive:nnn { mathchar          } { math_char_num } { 0 }
\__unravel_tex_primitive:nnn { mark              } { mark } { 0 }
\__unravel_tex_primitive:nnn { marks             } { mark } { 5 }
\__unravel_tex_primitive:nnn { show              } { xray } { 0 }
\__unravel_tex_primitive:nnn { showbox           } { xray } { 1 }
\__unravel_tex_primitive:nnn { showthe           } { xray } { 2 }
\__unravel_tex_primitive:nnn { showlists         } { xray } { 3 }
\__unravel_tex_primitive:nnn { showgroups        } { xray } { 4 }
\__unravel_tex_primitive:nnn { showtokens        } { xray } { 5 }
\__unravel_tex_primitive:nnn { showifs           } { xray } { 6 }
\__unravel_tex_primitive:nnn { box               } { make_box } { 0 }
\__unravel_tex_primitive:nnn { copy              } { make_box } { 1 }
\__unravel_tex_primitive:nnn { lastbox           } { make_box } { 2 }
\__unravel_tex_primitive:nnn { vsplit            } { make_box } { 3 }
\__unravel_tex_primitive:nnn { vtop              } { make_box } { 4 }
\__unravel_tex_primitive:nnn { vbox              } { make_box } { 5 }
\__unravel_tex_primitive:nnn { hbox              } { make_box } { 106 }
\__unravel_tex_primitive:nnn { moveright         } { hmove } { 0 }
\__unravel_tex_primitive:nnn { moveleft          } { hmove } { 1 }
\__unravel_tex_primitive:nnn { lower             } { vmove } { 0 }
\__unravel_tex_primitive:nnn { raise             } { vmove } { 1 }
\__unravel_tex_primitive:nnn { unhbox            } { un_hbox } { 0 }
\__unravel_tex_primitive:nnn { unhcopy           } { un_hbox } { 1 }
\__unravel_tex_primitive:nnn { unvbox            } { un_vbox } { 0 }
\__unravel_tex_primitive:nnn { unvcopy           } { un_vbox } { 1 }
\__unravel_tex_primitive:nnn { pagediscards      } { un_vbox } { 2 }
\__unravel_tex_primitive:nnn { splitdiscards     } { un_vbox } { 3 }
\__unravel_tex_primitive:nnn { unpenalty         } { remove_item } { 12 }
\__unravel_tex_primitive:nnn { unkern            } { remove_item } { 11 }
\__unravel_tex_primitive:nnn { unskip            } { remove_item } { 10 }
\__unravel_tex_primitive:nnn { hfil              } { hskip } { 0 }
\__unravel_tex_primitive:nnn { hfill             } { hskip } { 1 }
\__unravel_tex_primitive:nnn { hss               } { hskip } { 2 }
\__unravel_tex_primitive:nnn { hfilneg           } { hskip } { 3 }
\__unravel_tex_primitive:nnn { hskip             } { hskip } { 4 }
\__unravel_tex_primitive:nnn { vfil              } { vskip } { 0 }
\__unravel_tex_primitive:nnn { vfill             } { vskip } { 1 }
\__unravel_tex_primitive:nnn { vss               } { vskip } { 2 }
\__unravel_tex_primitive:nnn { vfilneg           } { vskip } { 3 }
\__unravel_tex_primitive:nnn { vskip             } { vskip } { 4 }
\__unravel_tex_primitive:nnn { mskip             } { mskip } { 5 }
\__unravel_tex_primitive:nnn { kern              } { kern } { 1 }
\__unravel_tex_primitive:nnn { mkern             } { mkern } { 99 }
\__unravel_tex_primitive:nnn { shipout           } { leader_ship } { 99 }
\__unravel_tex_primitive:nnn { leaders           } { leader_ship } { 100 }
\__unravel_tex_primitive:nnn { cleaders          } { leader_ship } { 101 }
\__unravel_tex_primitive:nnn { xleaders          } { leader_ship } { 102 }
\__unravel_tex_primitive:nnn { halign            } { halign } { 0 }
\__unravel_tex_primitive:nnn { valign            } { valign } { 0 }
\__unravel_tex_primitive:nnn { beginL            } { valign } { 4 }
\__unravel_tex_primitive:nnn { endL              } { valign } { 5 }
\__unravel_tex_primitive:nnn { beginR            } { valign } { 8 }
\__unravel_tex_primitive:nnn { endR              } { valign } { 9 }
\__unravel_tex_primitive:nnn { noalign           } { no_align } { 0 }
\__unravel_tex_primitive:nnn { vrule             } { vrule } { 0 }
\__unravel_tex_primitive:nnn { hrule             } { hrule } { 0 }
\__unravel_tex_primitive:nnn { insert            } { insert } { 0 }
\__unravel_tex_primitive:nnn { vadjust           } { vadjust } { 0 }
\__unravel_tex_primitive:nnn { ignorespaces      } { ignore_spaces } { 0 }
\__unravel_tex_primitive:nnn { afterassignment   } { after_assignment } { 0 }
\__unravel_tex_primitive:nnn { aftergroup        } { after_group } { 0 }
\__unravel_tex_primitive:nnn { penalty           } { break_penalty } { 0 }
\__unravel_tex_primitive:nnn { indent            } { start_par } { 1 }
\__unravel_tex_primitive:nnn { noindent          } { start_par } { 0 }
\__unravel_tex_primitive:nnn { quitvmode         } { start_par } { 2 }
\__unravel_tex_primitive:nnn { /                 } { ital_corr } { 0 }
\__unravel_tex_primitive:nnn { accent            } { accent } { 0 }
\__unravel_tex_primitive:nnn { mathaccent        } { math_accent } { 0 }
\__unravel_tex_primitive:nnn { -                 } { discretionary } { 1 }
\__unravel_tex_primitive:nnn { discretionary     } { discretionary } { 0 }
\__unravel_tex_primitive:nnn { eqno              } { eq_no } { 0 }
\__unravel_tex_primitive:nnn { leqno             } { eq_no } { 1 }
\__unravel_tex_primitive:nnn { left              } { left_right } { 30 }
\__unravel_tex_primitive:nnn { right             } { left_right } { 31 }
\__unravel_tex_primitive:nnn { middle            } { left_right } { 17 }
\__unravel_tex_primitive:nnn { mathord           } { math_comp } { 16 }
\__unravel_tex_primitive:nnn { mathop            } { math_comp } { 17 }
\__unravel_tex_primitive:nnn { mathbin           } { math_comp } { 18 }
\__unravel_tex_primitive:nnn { mathrel           } { math_comp } { 19 }
\__unravel_tex_primitive:nnn { mathopen          } { math_comp } { 20 }
\__unravel_tex_primitive:nnn { mathclose         } { math_comp } { 21 }
\__unravel_tex_primitive:nnn { mathpunct         } { math_comp } { 22 }
\__unravel_tex_primitive:nnn { mathinner         } { math_comp } { 23 }
\__unravel_tex_primitive:nnn { underline         } { math_comp } { 26 }
\__unravel_tex_primitive:nnn { overline          } { math_comp } { 27 }
\__unravel_tex_primitive:nnn { displaylimits     } { limit_switch } { 0 }
\__unravel_tex_primitive:nnn { limits            } { limit_switch } { 1 }
\__unravel_tex_primitive:nnn { nolimits          } { limit_switch } { 2 }
\__unravel_tex_primitive:nnn { above             } { above } { 0 }
\__unravel_tex_primitive:nnn { over              } { above } { 1 }
\__unravel_tex_primitive:nnn { atop              } { above } { 2 }
\__unravel_tex_primitive:nnn { abovewithdelims   } { above } { 3 }
\__unravel_tex_primitive:nnn { overwithdelims    } { above } { 4 }
\__unravel_tex_primitive:nnn { atopwithdelims    } { above } { 5 }
\__unravel_tex_primitive:nnn { displaystyle      } { math_style } { 0 }
\__unravel_tex_primitive:nnn { textstyle         } { math_style } { 2 }
\__unravel_tex_primitive:nnn { scriptstyle       } { math_style } { 4 }
\__unravel_tex_primitive:nnn { scriptscriptstyle } { math_style } { 6 }
\__unravel_tex_primitive:nnn { mathchoice        } { math_choice } { 0 }
\__unravel_tex_primitive:nnn { nonscript         } { non_script } { 0 }
\__unravel_tex_primitive:nnn { vcenter           } { vcenter } { 0 }
\__unravel_tex_primitive:nnn { lowercase         } { case_shift } { 256 }
\__unravel_tex_primitive:nnn { uppercase         } { case_shift } { 512 }
\__unravel_tex_primitive:nnn { message           } { message } { 0 }
\__unravel_tex_primitive:nnn { errmessage        } { message } { 1 }
\__unravel_tex_primitive:nnn { openout           } { extension } { 0 }
\__unravel_tex_primitive:nnn { write             } { extension } { 1 }
\__unravel_tex_primitive:nnn { closeout          } { extension } { 2 }
\__unravel_tex_primitive:nnn { special           } { extension } { 3 }
\__unravel_tex_primitive:nnn { immediate         } { extension } { 4 }
\__unravel_tex_primitive:nnn { setlanguage       } { extension } { 5 }
\__unravel_tex_primitive:nnn { pdfliteral        } { extension } { 6 }
\__unravel_tex_primitive:nnn { pdfobj            } { extension } { 7 }
\__unravel_tex_primitive:nnn { pdfrefobj         } { extension } { 8 }
\__unravel_tex_primitive:nnn { pdfxform          } { extension } { 9 }
\__unravel_tex_primitive:nnn { pdfrefxform       } { extension } { 10 }
\__unravel_tex_primitive:nnn { pdfximage         } { extension } { 11 }
\__unravel_tex_primitive:nnn { pdfrefximage      } { extension } { 12 }
\__unravel_tex_primitive:nnn { pdfannot          } { extension } { 13 }
\__unravel_tex_primitive:nnn { pdfstartlink      } { extension } { 14 }
\__unravel_tex_primitive:nnn { pdfendlink        } { extension } { 15 }
\__unravel_tex_primitive:nnn { pdfoutline        } { extension } { 16 }
\__unravel_tex_primitive:nnn { pdfdest           } { extension } { 17 }
\__unravel_tex_primitive:nnn { pdfthread         } { extension } { 18 }
\__unravel_tex_primitive:nnn { pdfstartthread    } { extension } { 19 }
\__unravel_tex_primitive:nnn { pdfendthread      } { extension } { 20 }
\__unravel_tex_primitive:nnn { pdfsavepos        } { extension } { 21 }
\__unravel_tex_primitive:nnn { pdfinfo           } { extension } { 22 }
\__unravel_tex_primitive:nnn { pdfcatalog        } { extension } { 23 }
\__unravel_tex_primitive:nnn { pdfnames          } { extension } { 24 }
\__unravel_tex_primitive:nnn { pdffontattr       } { extension } { 25 }
\__unravel_tex_primitive:nnn { pdfincludechars   } { extension } { 26 }
\__unravel_tex_primitive:nnn { pdfmapfile        } { extension } { 27 }
\__unravel_tex_primitive:nnn { pdfmapline        } { extension } { 28 }
\__unravel_tex_primitive:nnn { pdftrailer        } { extension } { 29 }
\__unravel_tex_primitive:nnn { pdfresettimer     } { extension } { 30 }
\__unravel_tex_primitive:nnn { pdffontexpand     } { extension } { 31 }
\__unravel_tex_primitive:nnn { pdfsetrandomseed  } { extension } { 32 }
\__unravel_tex_primitive:nnn { pdfsnaprefpoint   } { extension } { 33 }
\__unravel_tex_primitive:nnn { pdfsnapy          } { extension } { 34 }
\__unravel_tex_primitive:nnn { pdfsnapycomp      } { extension } { 35 }
\__unravel_tex_primitive:nnn { pdfglyphtounicode } { extension } { 36 }
\__unravel_tex_primitive:nnn { pdfcolorstack     } { extension } { 37 }
\__unravel_tex_primitive:nnn { pdfsetmatrix      } { extension } { 38 }
\__unravel_tex_primitive:nnn { pdfsave           } { extension } { 39 }
\__unravel_tex_primitive:nnn { pdfrestore        } { extension } { 40 }
\__unravel_tex_primitive:nnn { pdfnobuiltintounicode } { extension } { 41 }
\__unravel_tex_primitive:nnn { openin                } { in_stream } { 1 }
\__unravel_tex_primitive:nnn { closein               } { in_stream } { 0 }
\__unravel_tex_primitive:nnn { begingroup            } { begin_group } { 0 }
\__unravel_tex_primitive:nnn { endgroup              } { end_group } { 0 }
\__unravel_tex_primitive:nnn { omit                  } { omit } { 0 }
\__unravel_tex_primitive:nnn { ~                     } { ex_space } { 0 }
\__unravel_tex_primitive:nnn { noboundary            } { no_boundary } { 0 }
\__unravel_tex_primitive:nnn { radical               } { radical } { 0 }
\__unravel_tex_primitive:nnn { endcsname             } { end_cs_name } { 0 }
\__unravel_tex_primitive:nnn { lastpenalty           } { last_item } { 0 }
\__unravel_tex_primitive:nnn { lastkern              } { last_item } { 1 }
\__unravel_tex_primitive:nnn { lastskip              } { last_item } { 2 }
\__unravel_tex_primitive:nnn { lastnodetype          } { last_item } { 3 }
\__unravel_tex_primitive:nnn { inputlineno           } { last_item } { 4 }
\__unravel_tex_primitive:nnn { badness               } { last_item } { 5 }
\__unravel_tex_primitive:nnn { pdftexversion         } { last_item } { 6 }
\__unravel_tex_primitive:nnn { pdflastobj            } { last_item } { 7 }
\__unravel_tex_primitive:nnn { pdflastxform          } { last_item } { 8 }
\__unravel_tex_primitive:nnn { pdflastximage         } { last_item } { 9 }
\__unravel_tex_primitive:nnn { pdflastximagepages    } { last_item } { 10 }
\__unravel_tex_primitive:nnn { pdflastannot          } { last_item } { 11 }
\__unravel_tex_primitive:nnn { pdflastxpos           } { last_item } { 12 }
\__unravel_tex_primitive:nnn { pdflastypos           } { last_item } { 13 }
\__unravel_tex_primitive:nnn { pdfretval             } { last_item } { 14 }
\__unravel_tex_primitive:nnn { pdflastximagecolordepth } { last_item } { 15 }
\__unravel_tex_primitive:nnn { pdfelapsedtime        } { last_item } { 16 }
\__unravel_tex_primitive:nnn { pdfshellescape        } { last_item } { 17 }
\__unravel_tex_primitive:nnn { pdfrandomseed         } { last_item } { 18 }
\__unravel_tex_primitive:nnn { pdflastlink           } { last_item } { 19 }
\__unravel_tex_primitive:nnn { eTeXversion           } { last_item } { 20 }
\__unravel_tex_primitive:nnn { currentgrouplevel     } { last_item } { 21 }
\__unravel_tex_primitive:nnn { currentgrouptype      } { last_item } { 22 }
\__unravel_tex_primitive:nnn { currentiflevel        } { last_item } { 23 }
\__unravel_tex_primitive:nnn { currentiftype         } { last_item } { 24 }
\__unravel_tex_primitive:nnn { currentifbranch       } { last_item } { 25 }
\__unravel_tex_primitive:nnn { gluestretchorder      } { last_item } { 26 }
\__unravel_tex_primitive:nnn { glueshrinkorder       } { last_item } { 27 }
\__unravel_tex_primitive:nnn { fontcharwd            } { last_item } { 28 }
\__unravel_tex_primitive:nnn { fontcharht            } { last_item } { 29 }
\__unravel_tex_primitive:nnn { fontchardp            } { last_item } { 30 }
\__unravel_tex_primitive:nnn { fontcharic            } { last_item } { 31 }
\__unravel_tex_primitive:nnn { parshapelength        } { last_item } { 32 }
\__unravel_tex_primitive:nnn { parshapeindent        } { last_item } { 33 }
\__unravel_tex_primitive:nnn { parshapedimen         } { last_item } { 34 }
\__unravel_tex_primitive:nnn { gluestretch           } { last_item } { 35 }
\__unravel_tex_primitive:nnn { glueshrink            } { last_item } { 36 }
\__unravel_tex_primitive:nnn { mutoglue              } { last_item } { 37 }
\__unravel_tex_primitive:nnn { gluetomu              } { last_item } { 38 }
\__unravel_tex_primitive:nnn { numexpr               } { last_item } { 39 }
\__unravel_tex_primitive:nnn { dimexpr               } { last_item } { 40 }
\__unravel_tex_primitive:nnn { glueexpr              } { last_item } { 41 }
\__unravel_tex_primitive:nnn { muexpr                } { last_item } { 42 }
\__unravel_tex_primitive:nnn { toks } { toks_register } { 0 }
\__unravel_tex_primitive:nnn { output                } { assign_toks } { 1 }
\__unravel_tex_primitive:nnn { everypar              } { assign_toks } { 2 }
\__unravel_tex_primitive:nnn { everymath             } { assign_toks } { 3 }
\__unravel_tex_primitive:nnn { everydisplay          } { assign_toks } { 4 }
\__unravel_tex_primitive:nnn { everyhbox             } { assign_toks } { 5 }
\__unravel_tex_primitive:nnn { everyvbox             } { assign_toks } { 6 }
\__unravel_tex_primitive:nnn { everyjob              } { assign_toks } { 7 }
\__unravel_tex_primitive:nnn { everycr               } { assign_toks } { 8 }
\__unravel_tex_primitive:nnn { errhelp               } { assign_toks } { 9 }
\__unravel_tex_primitive:nnn { pdfpagesattr          } { assign_toks } { 10 }
\__unravel_tex_primitive:nnn { pdfpageattr           } { assign_toks } { 11 }
\__unravel_tex_primitive:nnn { pdfpageresources      } { assign_toks } { 12 }
\__unravel_tex_primitive:nnn { pdfpkmode             } { assign_toks } { 13 }
\__unravel_tex_primitive:nnn { everyeof              } { assign_toks } { 14 }
\__unravel_tex_primitive:nnn { pretolerance          } { assign_int } { 0 }
\__unravel_tex_primitive:nnn { tolerance             } { assign_int } { 1 }
\__unravel_tex_primitive:nnn { linepenalty           } { assign_int } { 2 }
\__unravel_tex_primitive:nnn { hyphenpenalty         } { assign_int } { 3 }
\__unravel_tex_primitive:nnn { exhyphenpenalty       } { assign_int } { 4 }
\__unravel_tex_primitive:nnn { clubpenalty           } { assign_int } { 5 }
\__unravel_tex_primitive:nnn { widowpenalty          } { assign_int } { 6 }
\__unravel_tex_primitive:nnn { displaywidowpenalty   } { assign_int } { 7 }
\__unravel_tex_primitive:nnn { brokenpenalty         } { assign_int } { 8 }
\__unravel_tex_primitive:nnn { binoppenalty          } { assign_int } { 9 }
\__unravel_tex_primitive:nnn { relpenalty            } { assign_int } { 10 }
\__unravel_tex_primitive:nnn { predisplaypenalty     } { assign_int } { 11 }
\__unravel_tex_primitive:nnn { postdisplaypenalty    } { assign_int } { 12 }
\__unravel_tex_primitive:nnn { interlinepenalty      } { assign_int } { 13 }
\__unravel_tex_primitive:nnn { doublehyphendemerits  } { assign_int } { 14 }
\__unravel_tex_primitive:nnn { finalhyphendemerits   } { assign_int } { 15 }
\__unravel_tex_primitive:nnn { adjdemerits           } { assign_int } { 16 }
\__unravel_tex_primitive:nnn { mag                   } { assign_int } { 17 }
\__unravel_tex_primitive:nnn { delimiterfactor       } { assign_int } { 18 }
\__unravel_tex_primitive:nnn { looseness             } { assign_int } { 19 }
\__unravel_tex_primitive:nnn { time                  } { assign_int } { 20 }
\__unravel_tex_primitive:nnn { day                   } { assign_int } { 21 }
\__unravel_tex_primitive:nnn { month                 } { assign_int } { 22 }
\__unravel_tex_primitive:nnn { year                  } { assign_int } { 23 }
\__unravel_tex_primitive:nnn { showboxbreadth        } { assign_int } { 24 }
\__unravel_tex_primitive:nnn { showboxdepth          } { assign_int } { 25 }
\__unravel_tex_primitive:nnn { hbadness              } { assign_int } { 26 }
\__unravel_tex_primitive:nnn { vbadness              } { assign_int } { 27 }
\__unravel_tex_primitive:nnn { pausing               } { assign_int } { 28 }
\__unravel_tex_primitive:nnn { tracingonline         } { assign_int } { 29 }
\__unravel_tex_primitive:nnn { tracingmacros         } { assign_int } { 30 }
\__unravel_tex_primitive:nnn { tracingstats          } { assign_int } { 31 }
\__unravel_tex_primitive:nnn { tracingparagraphs     } { assign_int } { 32 }
\__unravel_tex_primitive:nnn { tracingpages          } { assign_int } { 33 }
\__unravel_tex_primitive:nnn { tracingoutput         } { assign_int } { 34 }
\__unravel_tex_primitive:nnn { tracinglostchars      } { assign_int } { 35 }
\__unravel_tex_primitive:nnn { tracingcommands       } { assign_int } { 36 }
\__unravel_tex_primitive:nnn { tracingrestores       } { assign_int } { 37 }
\__unravel_tex_primitive:nnn { uchyph                } { assign_int } { 38 }
\__unravel_tex_primitive:nnn { outputpenalty         } { assign_int } { 39 }
\__unravel_tex_primitive:nnn { maxdeadcycles         } { assign_int } { 40 }
\__unravel_tex_primitive:nnn { hangafter             } { assign_int } { 41 }
\__unravel_tex_primitive:nnn { floatingpenalty       } { assign_int } { 42 }
\__unravel_tex_primitive:nnn { globaldefs            } { assign_int } { 43 }
\__unravel_tex_primitive:nnn { fam                   } { assign_int } { 44 }
\__unravel_tex_primitive:nnn { escapechar            } { assign_int } { 45 }
\__unravel_tex_primitive:nnn { defaulthyphenchar     } { assign_int } { 46 }
\__unravel_tex_primitive:nnn { defaultskewchar       } { assign_int } { 47 }
\__unravel_tex_primitive:nnn { endlinechar           } { assign_int } { 48 }
\__unravel_tex_primitive:nnn { newlinechar           } { assign_int } { 49 }
\__unravel_tex_primitive:nnn { language              } { assign_int } { 50 }
\__unravel_tex_primitive:nnn { lefthyphenmin         } { assign_int } { 51 }
\__unravel_tex_primitive:nnn { righthyphenmin        } { assign_int } { 52 }
\__unravel_tex_primitive:nnn { holdinginserts        } { assign_int } { 53 }
\__unravel_tex_primitive:nnn { errorcontextlines     } { assign_int } { 54 }
\__unravel_tex_primitive:nnn { pdfoutput             } { assign_int } { 55 }
\__unravel_tex_primitive:nnn { pdfcompresslevel      } { assign_int } { 56 }
\__unravel_tex_primitive:nnn { pdfdecimaldigits      } { assign_int } { 57 }
\__unravel_tex_primitive:nnn { pdfmovechars          } { assign_int } { 58 }
\__unravel_tex_primitive:nnn { pdfimageresolution    } { assign_int } { 59 }
\__unravel_tex_primitive:nnn { pdfpkresolution       } { assign_int } { 60 }
\__unravel_tex_primitive:nnn { pdfuniqueresname      } { assign_int } { 61 }
\__unravel_tex_primitive:nnn
  { pdfoptionalwaysusepdfpagebox    } { assign_int } { 62 }
\__unravel_tex_primitive:nnn
  { pdfoptionpdfinclusionerrorlevel } { assign_int } { 63 }
\__unravel_tex_primitive:nnn
  { pdfoptionpdfminorversion        } { assign_int } { 64 }
\__unravel_tex_primitive:nnn { pdfminorversion       } { assign_int } { 64 }
\__unravel_tex_primitive:nnn { pdfforcepagebox       } { assign_int } { 65 }
\__unravel_tex_primitive:nnn { pdfpagebox            } { assign_int } { 66 }
\__unravel_tex_primitive:nnn
  { pdfinclusionerrorlevel } { assign_int } { 67 }
\__unravel_tex_primitive:nnn { pdfgamma              } { assign_int } { 68 }
\__unravel_tex_primitive:nnn { pdfimagegamma         } { assign_int } { 69 }
\__unravel_tex_primitive:nnn { pdfimagehicolor       } { assign_int } { 70 }
\__unravel_tex_primitive:nnn { pdfimageapplygamma    } { assign_int } { 71 }
\__unravel_tex_primitive:nnn { pdfadjustspacing      } { assign_int } { 72 }
\__unravel_tex_primitive:nnn { pdfprotrudechars      } { assign_int } { 73 }
\__unravel_tex_primitive:nnn { pdftracingfonts       } { assign_int } { 74 }
\__unravel_tex_primitive:nnn { pdfobjcompresslevel   } { assign_int } { 75 }
\__unravel_tex_primitive:nnn
  { pdfadjustinterwordglue } { assign_int } { 76 }
\__unravel_tex_primitive:nnn { pdfprependkern        } { assign_int } { 77 }
\__unravel_tex_primitive:nnn { pdfappendkern         } { assign_int } { 78 }
\__unravel_tex_primitive:nnn { pdfgentounicode       } { assign_int } { 79 }
\__unravel_tex_primitive:nnn { pdfdraftmode          } { assign_int } { 80 }
\__unravel_tex_primitive:nnn { pdfinclusioncopyfonts } { assign_int } { 81 }
\__unravel_tex_primitive:nnn { tracingassigns        } { assign_int } { 82 }
\__unravel_tex_primitive:nnn { tracinggroups         } { assign_int } { 83 }
\__unravel_tex_primitive:nnn { tracingifs            } { assign_int } { 84 }
\__unravel_tex_primitive:nnn { tracingscantokens     } { assign_int } { 85 }
\__unravel_tex_primitive:nnn { tracingnesting        } { assign_int } { 86 }
\__unravel_tex_primitive:nnn { predisplaydirection   } { assign_int } { 87 }
\__unravel_tex_primitive:nnn { lastlinefit           } { assign_int } { 88 }
\__unravel_tex_primitive:nnn { savingvdiscards       } { assign_int } { 89 }
\__unravel_tex_primitive:nnn { savinghyphcodes       } { assign_int } { 90 }
\__unravel_tex_primitive:nnn { TeXXeTstate           } { assign_int } { 91 }
\__unravel_tex_primitive:nnn { parindent             } { assign_dimen } { 0 }
\__unravel_tex_primitive:nnn { mathsurround          } { assign_dimen } { 1 }
\__unravel_tex_primitive:nnn { lineskiplimit         } { assign_dimen } { 2 }
\__unravel_tex_primitive:nnn { hsize                 } { assign_dimen } { 3 }
\__unravel_tex_primitive:nnn { vsize                 } { assign_dimen } { 4 }
\__unravel_tex_primitive:nnn { maxdepth              } { assign_dimen } { 5 }
\__unravel_tex_primitive:nnn { splitmaxdepth         } { assign_dimen } { 6 }
\__unravel_tex_primitive:nnn { boxmaxdepth           } { assign_dimen } { 7 }
\__unravel_tex_primitive:nnn { hfuzz                 } { assign_dimen } { 8 }
\__unravel_tex_primitive:nnn { vfuzz                 } { assign_dimen } { 9 }
\__unravel_tex_primitive:nnn { delimitershortfall   } { assign_dimen } { 10 }
\__unravel_tex_primitive:nnn { nulldelimiterspace   } { assign_dimen } { 11 }
\__unravel_tex_primitive:nnn { scriptspace          } { assign_dimen } { 12 }
\__unravel_tex_primitive:nnn { predisplaysize       } { assign_dimen } { 13 }
\__unravel_tex_primitive:nnn { displaywidth         } { assign_dimen } { 14 }
\__unravel_tex_primitive:nnn { displayindent        } { assign_dimen } { 15 }
\__unravel_tex_primitive:nnn { overfullrule         } { assign_dimen } { 16 }
\__unravel_tex_primitive:nnn { hangindent           } { assign_dimen } { 17 }
\__unravel_tex_primitive:nnn { hoffset              } { assign_dimen } { 18 }
\__unravel_tex_primitive:nnn { voffset              } { assign_dimen } { 19 }
\__unravel_tex_primitive:nnn { emergencystretch     } { assign_dimen } { 20 }
\__unravel_tex_primitive:nnn { pdfhorigin           } { assign_dimen } { 21 }
\__unravel_tex_primitive:nnn { pdfvorigin           } { assign_dimen } { 22 }
\__unravel_tex_primitive:nnn { pdfpagewidth         } { assign_dimen } { 23 }
\__unravel_tex_primitive:nnn { pdfpageheight        } { assign_dimen } { 24 }
\__unravel_tex_primitive:nnn { pdflinkmargin        } { assign_dimen } { 25 }
\__unravel_tex_primitive:nnn { pdfdestmargin        } { assign_dimen } { 26 }
\__unravel_tex_primitive:nnn { pdfthreadmargin      } { assign_dimen } { 27 }
\__unravel_tex_primitive:nnn { pdffirstlineheight   } { assign_dimen } { 28 }
\__unravel_tex_primitive:nnn { pdflastlinedepth     } { assign_dimen } { 29 }
\__unravel_tex_primitive:nnn { pdfeachlineheight    } { assign_dimen } { 30 }
\__unravel_tex_primitive:nnn { pdfeachlinedepth     } { assign_dimen } { 31 }
\__unravel_tex_primitive:nnn { pdfignoreddimen      } { assign_dimen } { 32 }
\__unravel_tex_primitive:nnn { pdfpxdimen           } { assign_dimen } { 33 }
\__unravel_tex_primitive:nnn { lineskip              } { assign_glue } { 0 }
\__unravel_tex_primitive:nnn { baselineskip          } { assign_glue } { 1 }
\__unravel_tex_primitive:nnn { parskip               } { assign_glue } { 2 }
\__unravel_tex_primitive:nnn { abovedisplayskip      } { assign_glue } { 3 }
\__unravel_tex_primitive:nnn { belowdisplayskip      } { assign_glue } { 4 }
\__unravel_tex_primitive:nnn { abovedisplayshortskip } { assign_glue } { 5 }
\__unravel_tex_primitive:nnn { belowdisplayshortskip } { assign_glue } { 6 }
\__unravel_tex_primitive:nnn { leftskip              } { assign_glue } { 7 }
\__unravel_tex_primitive:nnn { rightskip             } { assign_glue } { 8 }
\__unravel_tex_primitive:nnn { topskip               } { assign_glue } { 9 }
\__unravel_tex_primitive:nnn { splittopskip          } { assign_glue } { 10 }
\__unravel_tex_primitive:nnn { tabskip               } { assign_glue } { 11 }
\__unravel_tex_primitive:nnn { spaceskip             } { assign_glue } { 12 }
\__unravel_tex_primitive:nnn { xspaceskip            } { assign_glue } { 13 }
\__unravel_tex_primitive:nnn { parfillskip           } { assign_glue } { 14 }
\__unravel_tex_primitive:nnn { thinmuskip       } { assign_mu_glue } { 15 }
\__unravel_tex_primitive:nnn { medmuskip        } { assign_mu_glue } { 16 }
\__unravel_tex_primitive:nnn { thickmuskip      } { assign_mu_glue } { 17 }
\__unravel_tex_primitive:nnn { fontdimen        } { assign_font_dimen } { 0 }
\__unravel_tex_primitive:nnn { hyphenchar       } { assign_font_int } { 0 }
\__unravel_tex_primitive:nnn { skewchar         } { assign_font_int } { 1 }
\__unravel_tex_primitive:nnn { lpcode           } { assign_font_int } { 2 }
\__unravel_tex_primitive:nnn { rpcode           } { assign_font_int } { 3 }
\__unravel_tex_primitive:nnn { efcode           } { assign_font_int } { 4 }
\__unravel_tex_primitive:nnn { tagcode          } { assign_font_int } { 5 }
\__unravel_tex_primitive:nnn { pdfnoligatures   } { assign_font_int } { 6 }
\__unravel_tex_primitive:nnn { knbscode         } { assign_font_int } { 7 }
\__unravel_tex_primitive:nnn { stbscode         } { assign_font_int } { 8 }
\__unravel_tex_primitive:nnn { shbscode         } { assign_font_int } { 9 }
\__unravel_tex_primitive:nnn { knbccode         } { assign_font_int } { 10 }
\__unravel_tex_primitive:nnn { knaccode         } { assign_font_int } { 11 }
\__unravel_tex_primitive:nnn { spacefactor      } { set_aux } { 102 }
\__unravel_tex_primitive:nnn { prevdepth        } { set_aux } { 1 }
\__unravel_tex_primitive:nnn { prevgraf         } { set_prev_graf } { 0 }
\__unravel_tex_primitive:nnn { pagegoal         } { set_page_dimen } { 0 }
\__unravel_tex_primitive:nnn { pagetotal        } { set_page_dimen } { 1 }
\__unravel_tex_primitive:nnn { pagestretch      } { set_page_dimen } { 2 }
\__unravel_tex_primitive:nnn { pagefilstretch   } { set_page_dimen } { 3 }
\__unravel_tex_primitive:nnn { pagefillstretch  } { set_page_dimen } { 4 }
\__unravel_tex_primitive:nnn { pagefilllstretch } { set_page_dimen } { 5 }
\__unravel_tex_primitive:nnn { pageshrink       } { set_page_dimen } { 6 }
\__unravel_tex_primitive:nnn { pagedepth        } { set_page_dimen } { 7 }
\__unravel_tex_primitive:nnn { deadcycles       } { set_page_int } { 0 }
\__unravel_tex_primitive:nnn { insertpenalties  } { set_page_int } { 1 }
\__unravel_tex_primitive:nnn { interactionmode  } { set_page_int } { 2 }
\__unravel_tex_primitive:nnn { wd               } { set_box_dimen } { 1 }
\__unravel_tex_primitive:nnn { dp               } { set_box_dimen } { 2 }
\__unravel_tex_primitive:nnn { ht               } { set_box_dimen } { 3 }
\__unravel_tex_primitive:nnn { parshape              } { set_shape } { 0 }
\__unravel_tex_primitive:nnn { interlinepenalties    } { set_shape } { 1 }
\__unravel_tex_primitive:nnn { clubpenalties         } { set_shape } { 2 }
\__unravel_tex_primitive:nnn { widowpenalties        } { set_shape } { 3 }
\__unravel_tex_primitive:nnn { displaywidowpenalties } { set_shape } { 4 }
\__unravel_tex_primitive:nnn { catcode               } { def_code } { 0 }
\__unravel_tex_primitive:nnn { lccode                } { def_code } { 256 }
\__unravel_tex_primitive:nnn { uccode                } { def_code } { 512 }
\__unravel_tex_primitive:nnn { sfcode                } { def_code } { 768 }
\__unravel_tex_primitive:nnn { mathcode              } { def_code } { 1024 }
\__unravel_tex_primitive:nnn { delcode               } { def_code } { 1591 }
\__unravel_tex_primitive:nnn { textfont              } { def_family } { -48 }
\__unravel_tex_primitive:nnn { scriptfont            } { def_family } { -32 }
\__unravel_tex_primitive:nnn { scriptscriptfont      } { def_family } { -16 }
\__unravel_tex_primitive:nnn { nullfont              } { set_font } { 0 }
\__unravel_tex_primitive:nnn { font                  } { def_font } { 0 }
\__unravel_tex_primitive:nnn { count           } { register } { 1 000 000 }
\__unravel_tex_primitive:nnn { dimen           } { register } { 2 000 000 }
\__unravel_tex_primitive:nnn { skip            } { register } { 3 000 000 }
\__unravel_tex_primitive:nnn { muskip          } { register } { 4 000 000 }
\__unravel_tex_primitive:nnn { advance         } { advance } { 0 }
\__unravel_tex_primitive:nnn { multiply        } { multiply } { 0 }
\__unravel_tex_primitive:nnn { divide          } { divide } { 0 }
\__unravel_tex_primitive:nnn { long            } { prefix } { 1 }
\__unravel_tex_primitive:nnn { outer           } { prefix } { 2 }
\__unravel_tex_primitive:nnn { global          } { prefix } { 4 }
\__unravel_tex_primitive:nnn { protected       } { prefix } { 8 }
\__unravel_tex_primitive:nnn { let             } { let } { 0 }
\__unravel_tex_primitive:nnn { futurelet       } { let } { 1 }
\__unravel_tex_primitive:nnn { chardef         } { shorthand_def } { 0 }
\__unravel_tex_primitive:nnn { mathchardef     } { shorthand_def } { 1 }
\__unravel_tex_primitive:nnn { countdef        } { shorthand_def } { 2 }
\__unravel_tex_primitive:nnn { dimendef        } { shorthand_def } { 3 }
\__unravel_tex_primitive:nnn { skipdef         } { shorthand_def } { 4 }
\__unravel_tex_primitive:nnn { muskipdef       } { shorthand_def } { 5 }
\__unravel_tex_primitive:nnn { toksdef         } { shorthand_def } { 6 }
\__unravel_tex_primitive:nnn { read            } { read_to_cs } { 0 }
\__unravel_tex_primitive:nnn { readline        } { read_to_cs } { 1 }
\__unravel_tex_primitive:nnn { def             } { def } { 0 }
\__unravel_tex_primitive:nnn { gdef            } { def } { 1 }
\__unravel_tex_primitive:nnn { edef            } { def } { 2 }
\__unravel_tex_primitive:nnn { xdef            } { def } { 3 }
\__unravel_tex_primitive:nnn { setbox          } { set_box } { 0 }
\__unravel_tex_primitive:nnn { hyphenation     } { hyph_data } { 0 }
\__unravel_tex_primitive:nnn { patterns        } { hyph_data } { 1 }
\__unravel_tex_primitive:nnn { batchmode       } { set_interaction } { 0 }
\__unravel_tex_primitive:nnn { nonstopmode     } { set_interaction } { 1 }
\__unravel_tex_primitive:nnn { scrollmode      } { set_interaction } { 2 }
\__unravel_tex_primitive:nnn { errorstopmode   } { set_interaction } { 3 }
\__unravel_tex_primitive:nnn { letterspacefont } { letterspace_font } { 0 }
\__unravel_tex_primitive:nnn { pdfcopyfont     } { pdf_copy_font } { 0 }
\__unravel_tex_primitive:nnn { undefined         } { undefined_cs } { 0 }
\__unravel_tex_primitive:nnn { ndefined          } { undefined_cs } { 0 }
\__unravel_tex_primitive:nnn { expandafter       } { expand_after } { 0 }
\__unravel_tex_primitive:nnn { unless            } { expand_after } { 1 }
\__unravel_tex_primitive:nnn { pdfprimitive      } { no_expand } { 1 }
\__unravel_tex_primitive:nnn { noexpand          } { no_expand } { 0 }
\__unravel_tex_primitive:nnn { input             } { input } { 0 }
\__unravel_tex_primitive:nnn { endinput          } { input } { 1 }
\__unravel_tex_primitive:nnn { scantokens        } { input } { 2 }
\__unravel_tex_primitive:nnn { if                } { if_test } { 0 }
\__unravel_tex_primitive:nnn { ifcat             } { if_test } { 1 }
\__unravel_tex_primitive:nnn { ifnum             } { if_test } { 2 }
\__unravel_tex_primitive:nnn { ifdim             } { if_test } { 3 }
\__unravel_tex_primitive:nnn { ifodd             } { if_test } { 4 }
\__unravel_tex_primitive:nnn { ifvmode           } { if_test } { 5 }
\__unravel_tex_primitive:nnn { ifhmode           } { if_test } { 6 }
\__unravel_tex_primitive:nnn { ifmmode           } { if_test } { 7 }
\__unravel_tex_primitive:nnn { ifinner           } { if_test } { 8 }
\__unravel_tex_primitive:nnn { ifvoid            } { if_test } { 9 }
\__unravel_tex_primitive:nnn { ifhbox            } { if_test } { 10 }
\__unravel_tex_primitive:nnn { ifvbox            } { if_test } { 11 }
\__unravel_tex_primitive:nnn { ifx               } { if_test } { 12 }
\__unravel_tex_primitive:nnn { ifeof             } { if_test } { 13 }
\__unravel_tex_primitive:nnn { iftrue            } { if_test } { 14 }
\__unravel_tex_primitive:nnn { iffalse           } { if_test } { 15 }
\__unravel_tex_primitive:nnn { ifcase            } { if_test } { 16 }
\__unravel_tex_primitive:nnn { ifdefined         } { if_test } { 17 }
\__unravel_tex_primitive:nnn { ifcsname          } { if_test } { 18 }
\__unravel_tex_primitive:nnn { iffontchar        } { if_test } { 19 }
\__unravel_tex_primitive:nnn { ifincsname        } { if_test } { 20 }
\__unravel_tex_primitive:nnn { ifpdfprimitive    } { if_test } { 21 }
\__unravel_tex_primitive:nnn { ifpdfabsnum       } { if_test } { 22 }
\__unravel_tex_primitive:nnn { ifpdfabsdim       } { if_test } { 23 }
\__unravel_tex_primitive:nnn { fi                } { fi_or_else } { 2 }
\__unravel_tex_primitive:nnn { else              } { fi_or_else } { 3 }
\__unravel_tex_primitive:nnn { or                } { fi_or_else } { 4 }
\__unravel_tex_primitive:nnn { csname            } { cs_name } { 0 }
\__unravel_tex_primitive:nnn { number            } { convert } { 0 }
\__unravel_tex_primitive:nnn { romannumeral      } { convert } { 1 }
\__unravel_tex_primitive:nnn { string            } { convert } { 2 }
\__unravel_tex_primitive:nnn { meaning           } { convert } { 3 }
\__unravel_tex_primitive:nnn { fontname          } { convert } { 4 }
\__unravel_tex_primitive:nnn { eTeXrevision      } { convert } { 5 }
\__unravel_tex_primitive:nnn { pdftexrevision    } { convert } { 6 }
\__unravel_tex_primitive:nnn { pdftexbanner      } { convert } { 7 }
\__unravel_tex_primitive:nnn { pdffontname       } { convert } { 8 }
\__unravel_tex_primitive:nnn { pdffontobjnum     } { convert } { 9 }
\__unravel_tex_primitive:nnn { pdffontsize       } { convert } { 10 }
\__unravel_tex_primitive:nnn { pdfpageref        } { convert } { 11 }
\__unravel_tex_primitive:nnn { pdfxformname      } { convert } { 12 }
\__unravel_tex_primitive:nnn { pdfescapestring   } { convert } { 13 }
\__unravel_tex_primitive:nnn { pdfescapename     } { convert } { 14 }
\__unravel_tex_primitive:nnn { leftmarginkern    } { convert } { 15 }
\__unravel_tex_primitive:nnn { rightmarginkern   } { convert } { 16 }
\__unravel_tex_primitive:nnn
  { \sys_if_engine_xetex:F { pdf } strcmp } { convert } { 17 }
\__unravel_tex_primitive:nnn { pdfcolorstackinit } { convert } { 18 }
\__unravel_tex_primitive:nnn { pdfescapehex      } { convert } { 19 }
\__unravel_tex_primitive:nnn { pdfunescapehex    } { convert } { 20 }
\__unravel_tex_primitive:nnn { pdfcreationdate   } { convert } { 21 }
\__unravel_tex_primitive:nnn { pdffilemoddate    } { convert } { 22 }
\__unravel_tex_primitive:nnn { pdffilesize       } { convert } { 23 }
\__unravel_tex_primitive:nnn { pdfmdfivesum      } { convert } { 24 }
\__unravel_tex_primitive:nnn { pdffiledump       } { convert } { 25 }
\__unravel_tex_primitive:nnn { pdfmatch          } { convert } { 26 }
\__unravel_tex_primitive:nnn { pdflastmatch      } { convert } { 27 }
\__unravel_tex_primitive:nnn { pdfuniformdeviate } { convert } { 28 }
\__unravel_tex_primitive:nnn { pdfnormaldeviate  } { convert } { 29 }
\__unravel_tex_primitive:nnn { pdfinsertht       } { convert } { 30 }
\__unravel_tex_primitive:nnn { pdfximagebbox     } { convert } { 31 }
\__unravel_tex_primitive:nnn { jobname           } { convert } { 32 }
\sys_if_engine_luatex:T
  {
    \__unravel_tex_primitive:nnn { directlua       } { convert } { 33 }
    \__unravel_tex_primitive:nnn { expanded        } { convert } { 34 }
    \__unravel_tex_primitive:nnn { luaescapestring } { convert } { 35 }
  }
\sys_if_engine_xetex:T
  {
    \__unravel_tex_primitive:nnn { Ucharcat        } { convert } { 40 }
  }
\__unravel_tex_primitive:nnn { the               } { the } { 0 }
\__unravel_tex_primitive:nnn { unexpanded        } { the } { 1 }
\__unravel_tex_primitive:nnn { detokenize        } { the } { 5 }
\__unravel_tex_primitive:nnn { topmark           } { top_bot_mark } { 0 }
\__unravel_tex_primitive:nnn { firstmark         } { top_bot_mark } { 1 }
\__unravel_tex_primitive:nnn { botmark           } { top_bot_mark } { 2 }
\__unravel_tex_primitive:nnn { splitfirstmark    } { top_bot_mark } { 3 }
\__unravel_tex_primitive:nnn { splitbotmark      } { top_bot_mark } { 4 }
\__unravel_tex_primitive:nnn { topmarks          } { top_bot_mark } { 5 }
\__unravel_tex_primitive:nnn { firstmarks        } { top_bot_mark } { 6 }
\__unravel_tex_primitive:nnn { botmarks          } { top_bot_mark } { 7 }
\__unravel_tex_primitive:nnn { splitfirstmarks   } { top_bot_mark } { 8 }
\__unravel_tex_primitive:nnn { splitbotmarks     } { top_bot_mark } { 9 }
\cs_new_protected:Npn \__unravel_get_next:
  {
    \__unravel_input_if_empty:TF
      { \__unravel_exit:w }
      {
        \__unravel_input_gpop:N \l__unravel_head_gtl
        \gtl_head_do:NN \l__unravel_head_gtl \__unravel_get_next_aux:w
        \gtl_if_tl:NTF \l__unravel_head_gtl
          {
            \tl_set:Nx \l__unravel_head_tl
              { \gtl_head:N \l__unravel_head_gtl }
            \token_if_eq_meaning:NNT
              \l__unravel_head_token \__unravel_special_relax:
              \__unravel_get_next_notexpanded:
          }
          { \tl_clear:N \l__unravel_head_tl }
      }
  }
\cs_new_protected:Npn \__unravel_get_next_aux:w
  { \cs_set_eq:NN \l__unravel_head_token }
\cs_set_protected:Npn \__unravel_tmp:w #1
  {
    \cs_new_protected:Npn \__unravel_get_next_notexpanded:
      {
        \tl_if_eq:onTF { \l__unravel_head_tl } { \__unravel_unravel_marker: }
          { \__unravel_get_next_marker: }
          {
            \__unravel_exp_args:NNx \use:nn \__unravel_notexpanded_test:w
              { \scan_stop: \exp_after:wN \cs_to_str:N \l__unravel_head_tl Z }
              \q_mark \__unravel_notexpanded_expand:n
              #1 Z \q_mark \use_none:n
              \q_stop
          }
      }
    \cs_new_protected:Npn \__unravel_notexpanded_test:w
        ##1 #1 ##2 Z \q_mark ##3##4 \q_stop
      { ##3 {##2} }
  }
\exp_args:Nx \__unravel_tmp:w { \scan_stop: \tl_to_str:n { notexpanded: } }
\group_begin:
  \char_set_catcode_active:n { 0 }
  \cs_new_protected:Npn \__unravel_notexpanded_expand:n #1
    {
      \__unravel_exp_args:Nx \tl_if_empty:nTF { \str_tail:n {#1} }
        {
          \group_begin:
          \char_set_lccode:nn { 0 } { `#1 }
          \tex_lowercase:D
            {
              \group_end:
              \__unravel_notexpanded_expand:N ^^@
            }
        }
        {
          \group_begin: \exp_args:NNc \group_end:
          \__unravel_notexpanded_expand:N { \use_none:n #1 }
        }
    }
\group_end:
\cs_new_protected:Npn \__unravel_notexpanded_expand:N #1
  {
    \gtl_set:Nn \l__unravel_head_gtl {#1}
    \tl_set:Nn \l__unravel_head_tl {#1}
    \cs_set_eq:NN \l__unravel_head_token \__unravel_special_relax:
  }
\cs_new_protected:Npn \__unravel_get_next_marker:
  {
    \__unravel_get_next:
    \tl_if_eq:onTF \l__unravel_head_tl { \__unravel:nn }
      { \__unravel_error:nxxxx { nested-unravel } { } { } { } { } }
      { \__unravel_error:nxxxx { internal } { marker~unknown } { } { } { } }
    \__unravel_input_gpop_item:NF \l__unravel_argi_tl
      { \__unravel_error:nxxxx { internal } { marker~1 } { } { } { } }
    \__unravel_input_gpop_item:NF \l__unravel_argii_tl
      { \__unravel_error:nxxxx { internal } { marker~2 } { } { } { } }
    \exp_args:Nno \keys_set:nn { unravel } \l__unravel_argi_tl
    \__unravel_exp_args:Nx \__unravel_back_input:n
      { \exp_not:N \exp_not:n { \exp_not:o \l__unravel_argii_tl } }
    \__unravel_get_next:
  }
\cs_new_protected:Npn \__unravel_get_token:
  {
    \__unravel_get_next:
    \__unravel_set_cmd:
  }
\cs_new_protected:Npn \__unravel_set_cmd:
  {
    \__unravel_set_cmd_aux_meaning:
    \__unravel_set_cmd_aux_primitive:oTF { \l__unravel_head_meaning_tl }
      { }
      {
        \__unravel_token_if_expandable:NTF \l__unravel_head_token
          {
            \token_if_macro:NTF \l__unravel_head_token
              { \__unravel_set_cmd_aux_macro: }
              { \__unravel_set_cmd_aux_unknown: }
          }
          {
            \token_if_cs:NTF \l__unravel_head_token
              { \__unravel_set_cmd_aux_cs: }
              { \__unravel_set_cmd_aux_char: }
          }
      }
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_meaning:
  {
    \tl_set:Nx \l__unravel_head_meaning_tl
      {
        \exp_after:wN \__unravel_strip_escape:w
        \token_to_meaning:N \l__unravel_head_token
        \tl_to_str:n { : }
      }
    \tl_set:Nx \l__unravel_head_meaning_tl
      {
        \exp_after:wN \__unravel_set_cmd_aux_meaning:w
          \l__unravel_head_meaning_tl \q_stop
      }
  }
\use:x
  {
    \cs_new:Npn \exp_not:N \__unravel_set_cmd_aux_meaning:w
      ##1 \token_to_str:N : ##2 \exp_not:N \q_stop {##1}
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_primitive:nTF #1#2
  {
    \cs_if_exist:cTF { c__unravel_tex_#1_tl }
      {
        \exp_last_unbraced:Nv \__unravel_set_cmd_aux_primitive:nn
          { c__unravel_tex_#1_tl }
        #2
      }
  }
\cs_generate_variant:Nn \__unravel_set_cmd_aux_primitive:nTF { o }
\cs_new_protected:Npn \__unravel_set_cmd_aux_primitive:nn #1#2
  {
    \int_set:Nn \l__unravel_head_cmd_int {#1}
    \int_set:Nn \l__unravel_head_char_int {#2}
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_macro:
  {
    \int_set:Nn \l__unravel_head_cmd_int { \__unravel_tex_use:n { call } }
    \int_zero:N \l__unravel_head_char_int
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_unknown:
  {
    \exp_last_unbraced:NV \__unravel_set_cmd_aux_primitive:nn
      \c__unravel_tex_relax_tl
    \__unravel_error:nxxxx { unknown-primitive }
      { \l__unravel_head_meaning_tl } { } { } { }
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_cs:
  {
    \__unravel_tl_if_in:ooTF \l__unravel_head_meaning_tl
      { \tl_to_str:n { elect~font } }
      {
        \exp_last_unbraced:NV \__unravel_set_cmd_aux_primitive:nn
          \c__unravel_tex_nullfont_tl
      }
      { \__unravel_set_cmd_aux_numeric: }
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_numeric:
  {
    \tl_set:Nx \l__unravel_tmpa_tl
      {
        \exp_after:wN \__unravel_set_cmd_aux_numeric:N
          \l__unravel_head_meaning_tl + 0
      }
    \exp_after:wN \__unravel_set_cmd_aux_numeric:w
      \l__unravel_tmpa_tl \q_stop
  }
\cs_new:Npn \__unravel_set_cmd_aux_numeric:N #1
  {
    \if_int_compare:w `#1 < `A \exp_stop_f:
      \exp_not:N \q_mark
      \exp_after:wN \use_i:nn
    \fi:
    #1 \__unravel_set_cmd_aux_numeric:N
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_numeric:w #1 \q_mark #2 \q_stop
  {
    \str_case:nnF {#1}
      {
        { char }     { \__unravel_set_cmd_aux_given:n { char_given } }
        { kchar }    { \__unravel_set_cmd_aux_given:n { char_given } }
        { mathchar } { \__unravel_set_cmd_aux_given:n { math_given } }
      }
      {
        \__unravel_set_cmd_aux_primitive:nTF {#1}
          { }
          { \__unravel_set_cmd_aux_unknown: }
        \int_add:Nn \l__unravel_head_char_int { 100 000 }
      }
    \int_add:Nn \l__unravel_head_char_int {#2}
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_given:n #1
  {
    \int_set:Nn \l__unravel_head_cmd_int { \__unravel_tex_use:n {#1} }
    \int_zero:N \l__unravel_head_char_int
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_char:
  {
    \tl_set:Nx \l__unravel_head_meaning_tl
      { \token_to_meaning:N \l__unravel_head_token }
    \token_if_eq_catcode:NNT \l__unravel_head_token \c_catcode_other_token
      { \tl_set:Nn \l__unravel_head_meaning_tl { other~ } }
    \exp_after:wN \__unravel_set_cmd_aux_char:w
      \l__unravel_head_meaning_tl \q_stop
    \__unravel_exp_args:NNx \int_set:Nn \l__unravel_head_char_int
      { ` \__unravel_token_to_char:N \l__unravel_head_token }
  }
\cs_new_protected:Npn \__unravel_set_cmd_aux_char:w #1 ~ #2 \q_stop
  {
    \int_set:Nn \l__unravel_head_cmd_int
      { \__unravel_tex_use:n { #1_char } }
  }
\cs_new:Npn \__unravel_input_to_str:
  {
    \int_step_function:nnnN \g__unravel_input_int { -1 } { 1 }
      \__unravel_input_to_str_aux:n
  }
\cs_new:Npn \__unravel_input_to_str_aux:n #1
  { \gtl_to_str:c { g__unravel_input_#1_gtl } }
\cs_new_protected:Npn \__unravel_input_if_empty:TF
  {
    \int_compare:nNnTF \g__unravel_input_int = 0
      { \use_i:nn }
      {
        \gtl_if_empty:cTF
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
          {
            \int_gdecr:N \g__unravel_input_int
            \__unravel_input_if_empty:TF
          }
          {
            \__unravel_input_split:
            \use_ii:nn
          }
      }
  }
\cs_new_protected:Npn \__unravel_input_split:
  {
    \int_compare:nNnT \g__unravel_input_int = 1
      {
        \exp_args:Nc \__unravel_input_split_aux:N
          { g__unravel_input_1_gtl }
      }
  }
\cs_new_protected:Npn \__unravel_input_split_aux:N #1
  {
    \gtl_if_tl:NT #1
      {
        \gtl_if_head_is_N_type:NT #1
          {
            \tl_set:Nx \l__unravel_input_tmpa_tl { \gtl_left_tl:N #1 }
            \__unravel_exp_args:NNx \use:nn
                \__unravel_input_split_auxii:N
                { \tl_head:N \l__unravel_input_tmpa_tl }
          }
      }
  }
\cs_new_protected:Npn \__unravel_input_split_auxii:N #1
  {
    \token_if_parameter:NF #1
      {
        \tl_replace_all:Nnn \l__unravel_input_tmpa_tl {#1}
          { \__unravel_input_split_end: \__unravel_input_split_auxiii:w #1 }
        \group_begin:
          \cs_set:Npn \__unravel_input_split_auxiii:w
            ##1 \__unravel_input_split_end: { + 1 }
          \int_gset:Nn \g__unravel_input_int
            { 0 \l__unravel_input_tmpa_tl \__unravel_input_split_end: }
        \group_end:
        \int_gset_eq:NN \g__unravel_input_tmpa_int \g__unravel_input_int
        \l__unravel_input_tmpa_tl \__unravel_input_split_end:
      }
  }
\cs_new:Npn \__unravel_input_split_end: { }
\cs_new_protected:Npn \__unravel_input_split_auxiii:w
    #1 \__unravel_input_split_end:
  {
    \gtl_gclear_new:c
      { g__unravel_input_ \int_use:N \g__unravel_input_tmpa_int _gtl }
    \gtl_gset:cn
      { g__unravel_input_ \int_use:N \g__unravel_input_tmpa_int _gtl } {#1}
    \int_gdecr:N \g__unravel_input_tmpa_int
  }
\cs_new_protected:Npn \__unravel_input_gset:n
  {
    \int_gzero:N \g__unravel_input_int
    \__unravel_back_input:n
  }
\cs_new_protected:Npn \__unravel_input_get:N #1
  {
    \__unravel_input_if_empty:TF
      { \gtl_set:Nn #1 { \q_no_value } }
      {
        \gtl_get_left:cN
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl } #1
      }
  }
\cs_new_protected:Npn \__unravel_input_gpop:N #1
  {
    \__unravel_input_if_empty:TF
      { \gtl_set:Nn #1 { \q_no_value } }
      {
        \gtl_gpop_left:cN
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl } #1
      }
  }
\cs_new_protected:Npn \__unravel_input_merge:
  {
    \int_gdecr:N \g__unravel_input_int
    \gtl_gconcat:ccc
      { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
      { g__unravel_input_ \int_eval:n { \g__unravel_input_int + 1 } _gtl }
      { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
    \gtl_gclear:c
      { g__unravel_input_ \int_eval:n { \g__unravel_input_int + 1 } _gtl }
  }
\prg_new_protected_conditional:Npnn \__unravel_input_gpop_item:N #1 { F }
  {
    \int_compare:nNnTF \g__unravel_input_int = 0
      { \prg_return_false: }
      {
        \exp_args:Nc \__unravel_input_gpop_item_aux:NN
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl } #1
      }
  }
\cs_new_protected:Npn \__unravel_input_gpop_item_aux:NN #1#2
  {
    \gtl_gpop_left_item:NNTF #1#2
      { \prg_return_true: }
      {
        \int_compare:nNnTF { \gtl_extra_end:N #1 } > 0
          { \prg_return_false: }
          {
            \int_compare:nNnTF \g__unravel_input_int = 1
              { \prg_return_false: }
              {
                \__unravel_input_merge:
                \exp_args:Nc \__unravel_input_gpop_item_aux:NN
                  {
                    g__unravel_input_
                    \int_use:N \g__unravel_input_int _gtl
                  }
                  #2
              }
          }
      }
  }
\cs_new_protected:Npn \__unravel_input_gpop_tl:N #1
  { \tl_clear:N #1 \__unravel_input_gpop_tl_aux:N #1 }
\cs_new_protected:Npn \__unravel_input_gpop_tl_aux:N #1
  {
    \int_compare:nNnF \g__unravel_input_int = 0
      {
        \exp_args:Nc \__unravel_input_gpop_tl_aux:NN
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl } #1
      }
  }
\cs_new_protected:Npn \__unravel_input_gpop_tl_aux:NN #1#2
  {
    \gtl_if_tl:NTF #1
      {
        \tl_put_right:Nx #2 { \gtl_left_tl:N #1 }
        \gtl_gclear:N #1
        \int_gdecr:N \g__unravel_input_int
        \__unravel_input_gpop_tl_aux:N #2
      }
      {
        \int_compare:nNnTF \g__unravel_input_int > 1
          { \int_compare:nNnTF { \gtl_extra_end:N #1 } > 0 }
          { \use_i:nn }
          {
            \tl_put_right:Nx #2 { \gtl_left_tl:N #1 }
            \gtl_gpop_left_tl:N #1
          }
          {
            \__unravel_input_merge:
            \__unravel_input_gpop_tl_aux:N #2
          }
      }
  }
\cs_new_protected:Npn \__unravel_back_input:n
  {
    \int_gincr:N \g__unravel_input_int
    \gtl_gclear_new:c { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
    \gtl_gset:cn { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
  }
\cs_generate_variant:Nn \__unravel_back_input:n { V , o }
\cs_new_protected:Npn \__unravel_back_input:x
  { \__unravel_exp_args:Nx \__unravel_back_input:n }
\cs_new_protected:Npn \__unravel_back_input_gtl:N #1
  {
    \gtl_if_tl:NTF #1
      { \__unravel_back_input:x { \gtl_left_tl:N #1 } }
      {
        \gtl_gconcat:cNc
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
          #1
          { g__unravel_input_ \int_use:N \g__unravel_input_int _gtl }
      }
  }
\cs_new_protected:Npn \__unravel_back_input:
  { \__unravel_back_input_gtl:N \l__unravel_head_gtl }
\cs_new_protected:Npn \__unravel_back_input_tl_o:
  {
    \tl_set:Nx \l__unravel_tmpa_tl
      { \exp_args:NV \exp_not:o \l__unravel_head_tl }
    \__unravel_back_input:V \l__unravel_tmpa_tl
    \__unravel_print_expansion:x
      { \tl_to_str:N \l__unravel_head_tl = \tl_to_str:N \l__unravel_tmpa_tl }
  }
\cs_new_protected:Npn \__unravel_insert_relax:
  {
    \__unravel_back_input:
    \gtl_set_eq:NN \l__unravel_head_gtl \c__unravel_frozen_relax_gtl
    \__unravel_back_input:
    \__unravel_print_action:
  }
\cs_new_protected:Npn \__unravel_insert_group_begin_error:
  {
    \tl_set_eq:NN \l__unravel_tmpa_tl \l__unravel_head_tl
    \__unravel_back_input:
    \gtl_set_eq:NN \l__unravel_head_gtl \c_group_begin_gtl
    \__unravel_back_input:
    \__unravel_tex_error:nV { missing-lbrace } \l__unravel_tmpa_tl
    \__unravel_print_action:
  }
\cs_new_protected:Npn \__unravel_insert_dollar_error:
  {
    \__unravel_back_input:
    \__unravel_back_input:n { $ } % $
    \__unravel_error:nnnnn { missing-dollar } { } { } { } { }
    \__unravel_print_action:
  }
\use:x
  {
    \exp_not:n { \cs_new:Npn \__unravel_macro_split_do:NN #1 }
      {
        \exp_not:n { \exp_after:wN \__unravel_macro_split_do:wN }
        \exp_not:n { \token_to_meaning:N #1 \q_mark { } }
        \tl_to_str:n { : } \exp_not:n { -> \q_mark \use_none:nnnn }
        \exp_not:N \q_stop
      }
    \exp_not:n { \cs_new:Npn \__unravel_macro_split_do:wN }
        \exp_not:n {#1} \tl_to_str:n { : } \exp_not:n { #2 -> }
        \exp_not:n { #3 \q_mark #4 #5 \q_stop #6 }
      { \exp_not:n { #4 #6 {#1} {#2} {#3} } }
  }
\cs_new:Npn \__unravel_macro_prefix:N #1
  { \__unravel_macro_split_do:NN #1 \use_i:nnn }
\cs_new:Npn \__unravel_macro_parameter:N #1
  { \__unravel_macro_split_do:NN #1 \use_ii:nnn }
\cs_new:Npn \__unravel_macro_replacement:N #1
  { \__unravel_macro_split_do:NN #1 \use_iii:nnn }
\cs_new_protected:Npn \__unravel_macro_call:
  {
    \bool_if:NTF \g__unravel_speedup_macros_bool
      {
        \tl_set:Nx \l__unravel_tmpa_tl
          {^ \exp_after:wN \__unravel_macro_parameter:N \l__unravel_head_tl }
        \__unravel_tl_if_in:ooTF \c__unravel_parameters_tl \l__unravel_tmpa_tl
          { \__unravel_macro_call_quick: } { \__unravel_macro_call_safe: }
      }
      { \__unravel_macro_call_safe: }
    \exp_args:NV \__unravel_back_input:o \l__unravel_head_tl
    \__unravel_print_expansion:
  }
\cs_new_protected:Npn \__unravel_macro_call_safe:
  {
    \__unravel_input_gpop_tl:N \l__unravel_tmpa_tl
    \tl_put_right:NV \l__unravel_head_tl \l__unravel_tmpa_tl
  }
\cs_new_protected:Npn \__unravel_macro_call_quick:
  {
    \exp_after:wN \__unravel_macro_call_quick_loop:NNN \l__unravel_tmpa_tl
      { ? \use_none_delimit_by_q_stop:w } \q_stop
  }
\cs_new_protected:Npn \__unravel_macro_call_quick_loop:NNN #1#2#3
  {
    \use_none:n #2
    \__unravel_input_gpop_item:NF \l__unravel_tmpa_tl
      { \__unravel_macro_call_quick_runaway:Nw #3 }
    \tl_put_right:Nx \l__unravel_head_tl
      { { \exp_not:V \l__unravel_tmpa_tl } }
    \__unravel_macro_call_quick_loop:NNN
    #3
  }
\cs_new_protected:Npn \__unravel_macro_call_quick_runaway:Nw #1#2 \q_stop
  {
    \__unravel_error:nxxxx { runaway-macro-parameter }
      { \tl_to_str:N \l__unravel_head_tl } { \tl_to_str:n {#1} } { } { }
  }
\cs_new_protected:Npn \__unravel_expand_do:N
  {
    \__unravel_set_action_text:
    \bool_if:NT \g__unravel_internal_debug_bool
      {
        \__unravel_set_cmd:
        \__unravel_exp_args:Nx \iow_term:n { Exp:~\int_to_arabic:n { \l__unravel_head_cmd_int } }
      }
    \token_if_macro:NTF \l__unravel_head_token
      { \__unravel_macro_call: }
      { \__unravel_expand_nonmacro: }
  }
\cs_new_protected:Npn \__unravel_expand_nonmacro:
  {
    \__unravel_set_cmd_aux_meaning:
    \__unravel_set_cmd_aux_primitive:oTF { \l__unravel_head_meaning_tl }
      {
        \cs_if_exist_use:cF
          { __unravel_expandable_ \int_use:N \l__unravel_head_cmd_int : }
          { \__unravel_error:nxxxx { internal } { expandable } { } { } { } }
      }
      {
        \__unravel_error:nxxxx { unknown-primitive }
          { \l__unravel_head_meaning_tl } { } { } { }
        \__unravel_input_gpop_tl:N \l__unravel_tmpa_tl
        \tl_put_right:NV \l__unravel_head_tl \l__unravel_tmpa_tl
        \exp_args:NV \__unravel_back_input:o \l__unravel_head_tl
        \__unravel_print_expansion:
      }
  }
\cs_new_protected:Npn \__unravel_get_x_next:
  {
    \__unravel_get_next:
    \__unravel_token_if_expandable:NT \l__unravel_head_token
      { \__unravel_expand_do:N \__unravel_get_x_next: }
  }
\cs_new_protected:Npn \__unravel_get_x_or_protected:
  {
    \__unravel_get_next:
    \__unravel_token_if_protected:NF \l__unravel_head_token
      { \__unravel_expand_do:N \__unravel_get_x_or_protected: }
  }
\cs_new_protected:Npn \__unravel_get_token_xdef:
  {
    \__unravel_get_next:
    \__unravel_token_if_protected:NF \l__unravel_head_token
      { \__unravel_expand_do:N \__unravel_get_token_xdef: }
  }
\cs_new_protected:Npn \__unravel_get_token_x:
  {
    \__unravel_get_next:
    \__unravel_token_if_protected:NF \l__unravel_head_token
      { \__unravel_expand_do:N \__unravel_get_token_x: }
  }
\cs_new_protected:Npn \__unravel_get_x_non_blank:
  {
    \__unravel_get_x_next:
    \token_if_eq_catcode:NNT \l__unravel_head_token \c_space_token
      { \__unravel_get_x_non_blank: }
  }
\cs_new_protected:Npn \__unravel_get_x_non_relax:
  {
    \__unravel_get_x_next:
    \token_if_eq_meaning:NNTF \l__unravel_head_token \scan_stop:
      { \__unravel_get_x_non_relax: }
      {
        \token_if_eq_meaning:NNTF \l__unravel_head_token \__unravel_special_relax:
          { \__unravel_get_x_non_relax: }
          {
            \token_if_eq_catcode:NNT \l__unravel_head_token \c_space_token
              { \__unravel_get_x_non_relax: }
          }
      }
  }
\cs_new_protected:Npn \__unravel_skip_optional_space:
  {
    \__unravel_get_x_next:
    \token_if_eq_catcode:NNF \l__unravel_head_token \c_space_token
      { \__unravel_back_input: }
  }
\cs_new_protected:Npn \__unravel_scan_optional_equals:
  {
    \__unravel_get_x_non_blank:
    \tl_if_eq:NNTF \l__unravel_head_tl \c__unravel_eq_tl
      { \__unravel_prev_input:n { = } }
      {
        \__unravel_prev_input_silent:n { = }
        \__unravel_back_input:
      }
  }
\cs_new_protected:Npn \__unravel_scan_left_brace:
  {
    \__unravel_get_x_non_relax:
    \token_if_eq_catcode:NNF \l__unravel_head_token \c_group_begin_token
      {
        \__unravel_insert_group_begin_error:
        \__unravel_get_next:
      }
  }
\cs_new_protected:Npn \__unravel_scan_keyword:n #1
  { \__unravel_scan_keyword:nTF {#1} { } { } }
\prg_new_protected_conditional:Npnn \__unravel_scan_keyword:n #1
  { T , F , TF }
  {
    \__unravel_prev_input_gpush_gtl:
    \__unravel_scan_keyword_loop:NNN \c_true_bool
      #1 \q_recursion_tail \q_recursion_tail \q_recursion_stop
  }
\cs_new_protected:Npn \__unravel_scan_keyword_loop:NNN #1#2#3
  {
    \quark_if_recursion_tail_stop_do:nn {#2}
      { \__unravel_scan_keyword_true: }
    \quark_if_recursion_tail_stop_do:nn {#3}
      { \__unravel_error:nxxxx { internal } { odd-keyword-length } { } { } { } }
    \__unravel_get_x_next:
    \__unravel_scan_keyword_test:NNTF #2#3
      {
        \__unravel_prev_input_gtl:N \l__unravel_head_gtl
        \__unravel_scan_keyword_loop:NNN \c_false_bool
      }
      {
        \token_if_eq_catcode:NNF \l__unravel_head_token \c_space_token
          { \__unravel_scan_keyword_false:w }
        \bool_if:NF #1
          { \__unravel_scan_keyword_false:w }
        \__unravel_scan_keyword_loop:NNN #1#2#3
      }
  }
\prg_new_protected_conditional:Npnn \__unravel_scan_keyword_test:NN #1#2
  { TF }
  {
    \__unravel_gtl_if_head_is_definable:NTF \l__unravel_head_gtl
      { \prg_return_false: }
      {
        \str_if_eq:eeTF
          { \str_head:f { \gtl_to_str:N \l__unravel_head_gtl } } {#1}
          { \prg_return_true: }
          {
            \str_if_eq:eeTF
              { \str_head:f { \gtl_to_str:N \l__unravel_head_gtl } } {#2}
              { \prg_return_true: }
              { \prg_return_false: }
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_keyword_true:
  {
    \__unravel_prev_input_gpop_gtl:N \l__unravel_tmpb_gtl
    \__unravel_prev_input:x { \gtl_to_str:N \l__unravel_tmpb_gtl }
    \prg_return_true:
  }
\cs_new_protected:Npn \__unravel_scan_keyword_false:w
    #1 \q_recursion_stop
  {
    \__unravel_back_input:
    \__unravel_prev_input_gpop_gtl:N \l__unravel_tmpb_gtl
    \__unravel_back_input_gtl:N \l__unravel_tmpb_gtl
    \prg_return_false:
  }
\cs_new_protected:Npn \__unravel_scan_to:
  {
    \__unravel_scan_keyword:nF { tToO }
      {
        \__unravel_error:nnnnn { missing-to } { } { } { } { }
        \__unravel_prev_input:n { to }
      }
  }
\cs_new_protected:Npn \__unravel_scan_font_ident:
  {
    \__unravel_get_x_non_blank:
    \__unravel_set_cmd:
    \int_case:nnF \l__unravel_head_cmd_int
      {
        { \__unravel_tex_use:n { def_font } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { letterspace_font } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { pdf_copy_font } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { set_font } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { def_family } }
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_int:
          }
      }
      {
        \__unravel_error:nnnnn { missing-font-id } { } { } { } { }
        \__unravel_back_input:
        \__unravel_prev_input:n { \__unravel_nullfont: }
      }
  }
\cs_new_protected:Npn \__unravel_scan_font_int:
  {
    \int_case:nnF \l__unravel_head_char_int
      {
        { 0 } { \__unravel_scan_font_ident: }
        { 1 } { \__unravel_scan_font_ident: }
        { 6 } { \__unravel_scan_font_ident: }
      }
      { \__unravel_scan_font_ident: \__unravel_scan_int: }
  }
\cs_new_protected:Npn \__unravel_scan_font_dimen:
  {
    \__unravel_scan_int:
    \__unravel_scan_font_ident:
  }
\cs_new_protected:Npn \__unravel_scan_something_internal:n #1
  {
    \__unravel_set_cmd:
    \__unravel_set_action_text:
    \tl_set:Nf \l__unravel_tmpa_tl { \__unravel_thing_case: }
    \exp_after:wN \__unravel_scan_something_aux:nwn
      \l__unravel_tmpa_tl \q_stop {#1}
  }
\cs_new_protected:Npn \__unravel_scan_something_aux:nwn #1#2 \q_stop #3
  {
    \int_compare:nT { #3 < 4 <= #1 }
      {
        \__unravel_back_input:
        \__unravel_tex_error:nV { missing-number } \l__unravel_head_tl
        \__unravel_thing_use_get:nnNN { 1 } {#3} \c_zero_dim \l__unravel_tmpa_tl
        \__unravel_scan_something_internal_auxii:Vn \l__unravel_tmpa_tl { 1 }
        \__unravel_break:w
      }
    \int_compare:nNnT {#1} = { 8 }
      {
        \__unravel_tex_error:nV { the-cannot } \l__unravel_head_tl
        \__unravel_scan_something_internal_auxii:nn 0 { 0 }
        \__unravel_break:w
      }
    \tl_if_empty:nF {#2}
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        #2
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
      }
    \int_compare:nNnTF {#3} < { 4 }
      { \__unravel_thing_use_get:nnNN {#1} {#3} \l__unravel_head_tl \l__unravel_tmpa_tl }
      { \tl_set:Nx \l__unravel_tmpa_tl { \__unravel_the:w \l__unravel_head_tl } }
    \__unravel_scan_something_internal_auxii:Vn \l__unravel_tmpa_tl {#1}
    \__unravel_break_point:
    \int_compare:nNnT {#3} < { 4 } { \__unravel_print_action: }
  }
\cs_new_protected:Npn \__unravel_scan_something_internal_auxii:nn #1#2
  {
    \__unravel_prev_input_silent:n {#1}
    \__unravel_set_action_text:
    \__unravel_set_action_text:x
      { \g__unravel_action_text_str \use:n { ~ => ~ } \tl_to_str:n {#1} }
    \int_gset:Nn \g__unravel_val_level_int {#2}
  }
\cs_generate_variant:Nn \__unravel_scan_something_internal_auxii:nn { V }
\cs_new:Npn \__unravel_thing_case:
  {
    \int_case:nnF \l__unravel_head_cmd_int
      {
        { 68 } { 0                         } % char_given
        { 69 } { 0                         } % math_given
        { 70 } { \__unravel_thing_last_item:      } % last_item
        { 71 } { 5 \__unravel_scan_toks_register: } % toks_register
        { 72 } { 5                         } % assign_toks
        { 73 } { 0                         } % assign_int
        { 74 } { 1                         } % assign_dimen
        { 75 } { 2                         } % assign_glue
        { 76 } { 3                         } % assign_mu_glue
        { 77 } { 1 \__unravel_scan_font_dimen:    } % assign_font_dimen
        { 78 } { 0 \__unravel_scan_font_int:      } % assign_font_int
        { 79 } { \__unravel_thing_set_aux:        } % set_aux
        { 80 } { 0                         } % set_prev_graf
        { 81 } { 1                         } % set_page_dimen
        { 82 } { 0                         } % set_page_int
        { 83 } { 1 \__unravel_scan_int:           } % set_box_dimen
        { 84 } { 0 \__unravel_scan_int:           } % set_shape
        { 85 } { 0 \__unravel_scan_int:           } % def_code
        { 86 } { 4 \__unravel_scan_int:           } % def_family
        { 87 } { 4                         } % set_font
        { 88 } { 4                         } % def_font
        { 89 } { \__unravel_thing_register:       } % register
        {101 } { 4                         } % letterspace_font
        {102 } { 4                         } % pdf_copy_font
      }
      { 8 }
  }
\cs_new:Npn \__unravel_thing_set_aux:
  { \int_compare:nNnTF \l__unravel_head_char_int = { 1 } { 1 } { 0 } }
\cs_new:Npn \__unravel_thing_last_item:
  {
    \int_compare:nNnTF \l__unravel_head_char_int < { 26 }
      {
        \int_case:nnF \l__unravel_head_char_int
          {
            { 1 } { 1 } % lastkern
            { 2 } { 2 } % lastskip
          }
          { 0 } % other integer parameters
      }
      {
        \int_case:nnF \l__unravel_head_char_int
          {
            { 26 } { 0 \__unravel_scan_normal_glue: } % gluestretchorder
            { 27 } { 0 \__unravel_scan_normal_glue: } % glueshrinkorder
            { 28 } % fontcharwd
              { 1 \__unravel_scan_font_ident: \__unravel_scan_int: }
            { 29 } % fontcharht
              { 1 \__unravel_scan_font_ident: \__unravel_scan_int: }
            { 30 } % fontchardp
              { 1 \__unravel_scan_font_ident: \__unravel_scan_int: }
            { 31 } % fontcharic
              { 1 \__unravel_scan_font_ident: \__unravel_scan_int: }
            { 32 } { 1 \__unravel_scan_int: } % parshapelength
            { 33 } { 1 \__unravel_scan_int: } % parshapeindent
            { 34 } { 1 \__unravel_scan_int: } % parshapedimen
            { 35 } { 1 \__unravel_scan_normal_glue: } % gluestretch
            { 36 } { 1 \__unravel_scan_normal_glue: } % glueshrink
            { 37 } { 2 \__unravel_scan_mu_glue: } % mutoglue
            { 38 } { 3 \__unravel_scan_normal_glue: } % gluetomu
            { 39 } % numepr
              { 0 \__unravel_scan_expr:N \__unravel_scan_int: }
            { 40 } % dimexpr
              { 1 \__unravel_scan_expr:N \__unravel_scan_normal_dimen: }
            { 41 } % glueexpr
              { 2 \__unravel_scan_expr:N \__unravel_scan_normal_glue: }
            { 42 } % muexpr
              { 3 \__unravel_scan_expr:N \__unravel_scan_mu_glue: }
          }
          { }
      }
  }
\cs_new:Npn \__unravel_thing_register:
  {
    \int_eval:n { \l__unravel_head_char_int / 1 000 000 - 1 }
    \int_compare:nNnT { \tl_tail:V \l__unravel_head_char_int } = 0
      { \__unravel_scan_int: }
  }
\cs_new_protected:Npn \__unravel_scan_toks_register:
  {
    \int_compare:nNnT \l__unravel_head_char_int = 0
      { \__unravel_scan_int: }
  }
\cs_new_protected:Npn \__unravel_thing_use_get:nnNN #1#2#3#4
  {
    \int_compare:nNnTF {#2} < { 3 }
      {
        \int_compare:nNnT {#1} = { 3 }
          { \__unravel_tex_error:nV { incompatible-units } #3 }
        \tl_set:Nx #4
          {
            \int_case:nn { \int_min:nn {#1} {#2} }
              {
                { 0 } \int_eval:n
                { 1 } \dim_eval:n
                { 2 } \skip_eval:n
              }
            { \int_compare:nNnT {#1} = { 3 } \tex_mutoglue:D #3 }
          }
      }
      {
        \int_case:nnF {#1}
          {
            { 0 } { \tl_set:Nx #4 { \int_eval:n {#3} } }
            { 3 } { \tl_set:Nx #4 { \muskip_eval:n {#3} } }
          }
          {
            \__unravel_tex_error:nV { incompatible-units } #3
            \tl_set:Nx #4 { \muskip_eval:n { \tex_gluetomu:D #3 } }
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_expr:N #1
  { \__unravel_scan_expr_aux:NN #1 \c_false_bool }
\cs_new_protected:Npn \__unravel_scan_expr_aux:NN #1#2
  {
    \__unravel_get_x_non_blank:
    \__unravel_scan_factor:N #1
    \__unravel_scan_expr_op:NN #1#2
  }
\cs_new_protected:Npn \__unravel_scan_expr_op:NN #1#2
  {
    \__unravel_get_x_non_blank:
    \tl_case:NnF \l__unravel_head_tl
      {
        \c__unravel_plus_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_expr_aux:NN #1#2
          }
        \c__unravel_minus_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_expr_aux:NN #1#2
          }
        \c__unravel_times_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_get_x_non_blank:
            \__unravel_scan_factor:N \__unravel_scan_int:
            \__unravel_scan_expr_op:NN #1#2
          }
        \c__unravel_over_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_get_x_non_blank:
            \__unravel_scan_factor:N \__unravel_scan_int:
            \__unravel_scan_expr_op:NN #1#2
          }
        \c__unravel_rp_tl
          {
            \bool_if:NTF #2
              { \__unravel_prev_input:V \l__unravel_head_tl }
              { \__unravel_back_input: }
          }
      }
      {
        \bool_if:NTF #2
          {
            \__unravel_error:nnnnn { missing-rparen } { } { } { } { }
            \__unravel_back_input:
            \__unravel_prev_input:V \c__unravel_rp_tl
          }
          {
            \token_if_eq_meaning:NNF \l__unravel_head_token \scan_stop:
              { \__unravel_back_input: }
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_factor:N #1
  {
    \tl_if_eq:NNTF \l__unravel_head_tl \c__unravel_lp_tl
      {
        \__unravel_prev_input:V \l__unravel_head_tl
        \__unravel_scan_expr_aux:NN #1 \c_true_bool
      }
      {
        \__unravel_back_input:
        #1
      }
  }
\cs_new_protected:Npn \__unravel_scan_signs:
  {
    \__unravel_get_x_non_blank:
    \tl_if_eq:NNTF \l__unravel_head_tl \c__unravel_plus_tl
      {
        \__unravel_prev_input:V \l__unravel_head_tl
        \__unravel_scan_signs:
      }
      {
        \tl_if_eq:NNT \l__unravel_head_tl \c__unravel_minus_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_signs:
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_int:
  {
    \__unravel_scan_signs:
    \__unravel_set_cmd:
    \__unravel_cmd_if_internal:TF
      { \__unravel_scan_something_internal:n { 0 } }
      { \__unravel_scan_int_char: }
  }
\cs_new_protected:Npn \__unravel_scan_int_char:
  {
    \tl_case:NnF \l__unravel_head_tl
      {
        \c__unravel_lq_tl { \__unravel_scan_int_lq: }
        \c__unravel_rq_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_get_x_next:
            \__unravel_scan_int_explicit:Nn \c_false_bool { ' }
          }
        \c__unravel_dq_tl
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_get_x_next:
            \__unravel_scan_int_explicit:Nn \c_false_bool { " }
          }
      }
      { \__unravel_scan_int_explicit:Nn \c_false_bool { } }
  }
\cs_new_protected:Npn \__unravel_scan_int_lq:
  {
    \__unravel_get_next:
    \__unravel_gtl_if_head_is_definable:NF \l__unravel_head_gtl
      {
        \tl_set:Nx \l__unravel_head_tl
          { \__unravel_token_to_char:N \l__unravel_head_token }
      }
    \tl_set:Nx \l__unravel_tmpa_tl
      { \int_eval:n { \exp_after:wN ` \l__unravel_head_tl } }
    \__unravel_prev_input_silent:V \l__unravel_tmpa_tl
    \__unravel_print_action:x
      { ` \gtl_to_str:N \l__unravel_head_gtl = \l__unravel_tmpa_tl }
    \__unravel_skip_optional_space:
  }
\cs_new_protected:Npn \__unravel_scan_int_explicit:Nn #1#2
  {
    \if_int_compare:w 1
        < #2 1 \exp_after:wN \exp_not:N \l__unravel_head_tl \exp_stop_f:
      \exp_after:wN \use_i:nn
    \else:
      \exp_after:wN \use_ii:nn
    \fi:
    {
      \__unravel_prev_input:V \l__unravel_head_tl
      \__unravel_get_x_next:
      \__unravel_scan_int_explicit:Nn \c_true_bool {#2}
    }
    {
      \token_if_eq_catcode:NNF \l__unravel_head_token \c_space_token
        { \__unravel_back_input: }
      \bool_if:NF #1
        {
          \__unravel_tex_error:nV { missing-number } \l__unravel_head_tl
          \__unravel_prev_input:n { 0 }
        }
    }
  }
\cs_new_protected:Npn \__unravel_scan_normal_dimen:
  { \__unravel_scan_dimen:nN { 2 } \c_false_bool }
\cs_new_protected:Npn \__unravel_scan_dimen:nN #1#2
  {
    \__unravel_scan_signs:
    \__unravel_prev_input_gpush:
    \__unravel_set_cmd:
    \__unravel_cmd_if_internal:TF
      {
        \int_compare:nNnTF {#1} = { 3 }
          { \__unravel_scan_something_internal:n { 3 } }
          { \__unravel_scan_something_internal:n { 1 } }
        \int_compare:nNnT \g__unravel_val_level_int = { 0 }
          { \__unravel_scan_dim_unit:nN {#1} #2 }
      }
      { \__unravel_scan_dimen_char:nN {#1} #2 }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_prev_input_silent:V \l__unravel_head_tl
  }
\cs_new_protected:Npn \__unravel_scan_dimen_char:nN #1#2
  {
    \tl_if_eq:NNT \l__unravel_head_tl \c__unravel_comma_tl
      { \tl_set_eq:NN \l__unravel_head_tl \c__unravel_point_tl }
    \tl_if_eq:NNTF \l__unravel_head_tl \c__unravel_point_tl
      {
        \__unravel_prev_input:n { . }
        \__unravel_scan_decimal_loop:
      }
      {
        \__unravel_tl_if_in:ooTF { 0123456789 } \l__unravel_head_tl
          {
            \__unravel_back_input:
            \__unravel_scan_int:
            \tl_if_eq:NNT \l__unravel_head_tl \c__unravel_comma_tl
              { \tl_set_eq:NN \l__unravel_head_tl \c__unravel_point_tl }
            \tl_if_eq:NNT \l__unravel_head_tl \c__unravel_point_tl
              {
                \__unravel_input_gpop:N \l__unravel_tmpb_gtl
                \__unravel_prev_input:n { . }
                \__unravel_scan_decimal_loop:
              }
          }
          {
            \__unravel_back_input:
            \__unravel_scan_int:
          }
      }
    \__unravel_scan_dim_unit:nN {#1} #2
  }
\cs_new_protected:Npn \__unravel_scan_dim_unit:nN #1#2
  {
    \bool_if:NT #2
      {
        \__unravel_scan_keyword:nT { fFiIlL }
          {
            \__unravel_scan_inf_unit_loop:
            \__unravel_break:w
          }
      }
    \__unravel_get_x_non_blank:
    \__unravel_set_cmd:
    \__unravel_cmd_if_internal:TF
      {
        \__unravel_prev_input_gpush:
        \__unravel_scan_something_internal:n {#1}
        \__unravel_prev_input_join_get:nN {#1} \l__unravel_tmpa_tl
        \__unravel_prev_input_gpush:N \l__unravel_tmpa_tl
        \__unravel_break:w
      }
      { \__unravel_back_input: }
    \int_compare:nNnT {#1} = { 3 }
      {
        \__unravel_scan_keyword:nT { mMuU } { \__unravel_break:w }
        \__unravel_tex_error:nV { missing-mu } \l__unravel_head_tl
        \__unravel_prev_input:n { mu }
        \__unravel_break:w
      }
    \__unravel_scan_keyword:nT { eEmM } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { eExX } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { pPxX } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { tTrRuUeE }
      { \__unravel_prepare_mag: }
    \__unravel_scan_keyword:nT { pPtT } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { iInN } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { pPcC } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { cCmM } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { mMmM } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { bBpP } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { dDdD } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { cCcC } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { nNdD } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { nNcC } { \__unravel_break:w }
    \__unravel_scan_keyword:nT { sSpP } { \__unravel_break:w }
    \__unravel_tex_error:nV { missing-pt } \l__unravel_head_tl
    \__unravel_prev_input:n { pt }
    \__unravel_break_point:
  }
\cs_new_protected:Npn \__unravel_scan_inf_unit_loop:
  { \__unravel_scan_keyword:nT { lL } { \__unravel_scan_inf_unit_loop: } }
\cs_new_protected:Npn \__unravel_scan_decimal_loop:
  {
    \__unravel_get_x_next:
    \tl_if_empty:NTF \l__unravel_head_tl
      { \use_ii:nn }
      { \__unravel_tl_if_in:ooTF { 0123456789 } \l__unravel_head_tl }
      {
        \__unravel_prev_input:V \l__unravel_head_tl
        \__unravel_scan_decimal_loop:
      }
      {
        \token_if_eq_catcode:NNF \l__unravel_head_token \c_space_token
          { \__unravel_back_input: }
        \__unravel_prev_input_silent:n { ~ }
      }
  }
\cs_new_protected:Npn \__unravel_scan_normal_glue:
  { \__unravel_scan_glue:n { 2 } }
\cs_new_protected:Npn \__unravel_scan_mu_glue:
  { \__unravel_scan_glue:n { 3 } }
\cs_new_protected:Npn \__unravel_scan_glue:n #1
  {
    \__unravel_prev_input_gpush:
    \__unravel_scan_signs:
    \__unravel_prev_input_gpush:
    \__unravel_set_cmd:
    \__unravel_cmd_if_internal:TF
      {
        \__unravel_scan_something_internal:n {#1}
        \int_case:nnF \g__unravel_val_level_int
          {
            { 0 } { \__unravel_scan_dim_unit:nN {#1} \c_false_bool }
            { 1 } { }
          }
          { \__unravel_break:w }
      }
      { \__unravel_back_input: \__unravel_scan_dimen:nN {#1} \c_false_bool }
    \__unravel_prev_input_join_get:nN {#1} \l__unravel_tmpa_tl
    \__unravel_prev_input_gpush:
    \__unravel_prev_input_gpush:N \l__unravel_tmpa_tl
    \__unravel_scan_keyword:nT { pPlLuUsS }
      { \__unravel_scan_dimen:nN {#1} \c_true_bool }
    \__unravel_scan_keyword:nT { mMiInNuUsS }
      { \__unravel_scan_dimen:nN {#1} \c_true_bool }
    \__unravel_break_point:
    \__unravel_prev_input_join_get:nN {#1} \l__unravel_tmpa_tl
    \__unravel_prev_input_silent:V \l__unravel_tmpa_tl
  }
\cs_new_protected:Npn \__unravel_scan_file_name:
  {
    \bool_gset_true:N \g__unravel_name_in_progress_bool
    \__unravel_get_x_non_blank:
    \__unravel_scan_file_name_loop:
    \bool_gset_false:N \g__unravel_name_in_progress_bool
    \__unravel_prev_input_silent:n { ~ }
  }
\cs_new_protected:Npn \__unravel_scan_file_name_loop:
  {
    \__unravel_gtl_if_head_is_definable:NTF \l__unravel_head_gtl
      { \__unravel_back_input: }
      {
        \tl_set:Nx \l__unravel_tmpa_tl
          { \__unravel_token_to_char:N \l__unravel_head_token }
        \tl_if_eq:NNF \l__unravel_tmpa_tl \c_space_tl
          {
            \__unravel_prev_input_silent:V \l__unravel_tmpa_tl
            \__unravel_get_x_next:
            \__unravel_scan_file_name_loop:
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_r_token:
  {
    \bool_do_while:nn
      { \tl_if_eq_p:NN \l__unravel_head_tl \c_space_tl }
      { \__unravel_get_next: }
    \__unravel_gtl_if_head_is_definable:NF \l__unravel_head_gtl
      {
        \__unravel_error:nnnnn { missing-cs } { } { } { } { }
        \__unravel_back_input:
        \tl_set:Nn \l__unravel_head_tl { \__unravel_inaccessible:w }
      }
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \tl_set_eq:NN \l__unravel_defined_tl \l__unravel_head_tl
  }
\cs_new_protected:Npn \__unravel_scan_toks_to_str:
  {
    \__unravel_prev_input_gpush:
    \__unravel_scan_toks:NN \c_false_bool \c_true_bool
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \__unravel_prev_input_silent:x
      { { \exp_after:wN \tl_to_str:n \l__unravel_tmpa_tl } }
  }
\cs_new_protected:Npn \__unravel_scan_pdf_ext_toks:
  {
    \__unravel_prev_input_gpush:
    \__unravel_scan_toks:NN \c_false_bool \c_true_bool
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \__unravel_prev_input_silent:x
      { { \exp_not:N \exp_not:n \exp_not:V \l__unravel_tmpa_tl } }
  }
\cs_new_protected:Npn \__unravel_scan_toks:NN #1#2
  {
    \bool_if:NT #1 { \__unravel_scan_param: }
    \__unravel_scan_left_brace:
    \bool_if:NTF #2
      { \__unravel_scan_group_x:N #1 }
      { \__unravel_scan_group_n:N #1 }
  }
\cs_new_protected:Npn \__unravel_scan_param:
  {
    \tl_clear:N \l__unravel_tmpa_tl
    \__unravel_scan_param_aux:
    \tl_put_right:NV \l__unravel_defining_tl \l__unravel_tmpa_tl
    \__unravel_prev_input_silent:V \l__unravel_tmpa_tl
  }
\cs_new_protected:Npn \__unravel_scan_param_aux:
  {
    \__unravel_get_next:
    \tl_concat:NNN \l__unravel_tmpa_tl
      \l__unravel_tmpa_tl \l__unravel_head_tl
    \tl_if_empty:NTF \l__unravel_head_tl
      { \__unravel_back_input: } { \__unravel_scan_param_aux: }
  }
\cs_new_protected:Npn \__unravel_scan_group_n:N #1
  {
    \gtl_set_eq:NN \l__unravel_head_gtl \c_group_begin_gtl
    \__unravel_back_input:
    \__unravel_input_gpop_item:NF \l__unravel_head_tl
      {
        \__unravel_error:nnnnn { runaway-text } { } { } { } { }
        \__unravel_exit:w
      }
    \tl_set:Nx \l__unravel_head_tl { { \exp_not:V \l__unravel_head_tl } }
    \bool_if:NT #1
      { \tl_put_right:NV \l__unravel_defining_tl \l__unravel_head_tl }
    \__unravel_prev_input_silent:V \l__unravel_head_tl
  }
\cs_new_protected:Npn \__unravel_scan_group_x:N #1
  {
    \__unravel_input_gpop_tl:N \l__unravel_head_tl
    \__unravel_back_input:V \l__unravel_head_tl
    \bool_if:NTF #1
      {
        \__unravel_prev_input_silent:V \c_left_brace_str
        \tl_put_right:Nn \l__unravel_defining_tl { { \if_false: } \fi: }
        \__unravel_scan_group_xdef:n { 1 }
      }
      {
        \__unravel_prev_input_gpush_gtl:
        \__unravel_prev_input_gtl:N \l__unravel_head_gtl
        \__unravel_scan_group_x:n { 1 }
        \__unravel_prev_input_gpop_gtl:N \l__unravel_tmpb_gtl
        \__unravel_prev_input_silent:x
          { \gtl_left_tl:N \l__unravel_tmpb_gtl }
      }
  }
\cs_new_protected:Npn \__unravel_scan_group_xdef:n #1
  {
    \__unravel_get_token_xdef:
    \tl_if_empty:NTF \l__unravel_head_tl
      {
        \gtl_if_head_is_group_begin:NTF \l__unravel_head_gtl
          {
            \__unravel_prev_input_silent:V \c_left_brace_str
            \tl_put_right:Nn \l__unravel_defining_tl { { \if_false: } \fi: }
            \__unravel_scan_group_xdef:f { \int_eval:n { #1 + 1 } }
          }
          {
            \__unravel_prev_input_silent:V \c_right_brace_str
            \tl_put_right:Nn \l__unravel_defining_tl { \if_false: { \fi: } }
            \int_compare:nNnF {#1} = 1
              { \__unravel_scan_group_xdef:f { \int_eval:n { #1 - 1 } } }
          }
      }
      {
        \__unravel_prev_input_silent:V \l__unravel_head_tl
        \tl_put_right:Nx \l__unravel_defining_tl
          { \exp_not:N \exp_not:N \exp_not:V \l__unravel_head_tl }
        \__unravel_scan_group_xdef:n {#1}
      }
  }
\cs_generate_variant:Nn \__unravel_scan_group_xdef:n { f }
\cs_new_protected:Npn \__unravel_scan_group_x:n #1
  {
    \__unravel_get_token_x:
    \__unravel_prev_input_gtl:N \l__unravel_head_gtl
    \tl_if_empty:NTF \l__unravel_head_tl
      {
        \gtl_if_head_is_group_begin:NTF \l__unravel_head_gtl
          { \__unravel_scan_group_x:f { \int_eval:n { #1 + 1 } } }
          {
            \int_compare:nNnF {#1} = 1
              { \__unravel_scan_group_x:f { \int_eval:n { #1 - 1 } } }
          }
      }
      { \__unravel_scan_group_x:n {#1} }
  }
\cs_generate_variant:Nn \__unravel_scan_group_x:n { f }
\cs_new_protected:Npn \__unravel_scan_alt_rule:
  {
    \__unravel_scan_keyword:nTF { wWiIdDtThH }
      {
        \__unravel_scan_normal_dimen:
        \__unravel_scan_alt_rule:
      }
      {
        \__unravel_scan_keyword:nTF { hHeEiIgGhHtT }
          {
            \__unravel_scan_normal_dimen:
            \__unravel_scan_alt_rule:
          }
          {
            \__unravel_scan_keyword:nT { dDeEpPtThH }
              {
                \__unravel_scan_normal_dimen:
                \__unravel_scan_alt_rule:
              }
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_spec:
  {
    \__unravel_scan_keyword:nTF { tToO } { \__unravel_scan_normal_dimen: }
      {
        \__unravel_scan_keyword:nT { sSpPrReEaAdD }
          { \__unravel_scan_normal_dimen: }
      }
    \__unravel_scan_left_brace:
  }
\cs_new_protected:Npn \__unravel_do_box:N #1
  {
    \__unravel_get_x_non_relax:
    \__unravel_set_cmd:
    \int_compare:nNnTF
      \l__unravel_head_cmd_int = { \__unravel_tex_use:n { make_box } }
      { \__unravel_do_begin_box:N #1 }
      {
        \bool_if:NTF #1
          {
            \int_case:nnTF \l__unravel_head_cmd_int
              {
                { \__unravel_tex_use:n { hrule } } { }
                { \__unravel_tex_use:n { vrule } } { }
              }
              { \__unravel_do_leaders_rule: }
              { \__unravel_do_box_error: }
          }
          { \__unravel_do_box_error: }
      }
  }
\cs_new_protected:Npn \__unravel_do_box_error:
  {
    \__unravel_back_input:
    \__unravel_error:nnnnn { missing-box } { } { } { } { }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\cs_new_protected:Npn \__unravel_do_begin_box:N #1
  {
    \__unravel_prev_input:V \l__unravel_head_tl
    \int_case:nnTF \l__unravel_head_char_int
      {
        { 0 } { \__unravel_scan_int: } % box
        { 1 } { \__unravel_scan_int: } % copy
        { 2 } { } % lastbox
        { 3 } % vsplit
          {
            \__unravel_scan_int:
            \__unravel_scan_to:
            \__unravel_scan_normal_dimen:
          }
      }
      { \__unravel_do_simple_box:N #1 }
      { \__unravel_do_box_explicit:N #1 }
  }
\cs_new_protected:Npn \__unravel_do_simple_box:N #1
  {
    \bool_if:NTF #1 { \__unravel_do_leaders_fetch_skip: }
      {
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \tl_if_head_eq_meaning:VNT \l__unravel_head_tl \tex_shipout:D
          { \__unravel_prepare_mag: }
        \tl_use:N \l__unravel_head_tl \scan_stop:
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
      }
  }
\cs_new_protected:Npn \__unravel_do_leaders_fetch_skip:
  {
    \__unravel_get_x_non_relax:
    \__unravel_set_cmd:
    \int_compare:nNnTF \l__unravel_head_cmd_int
      = { \__unravel_tex_use:n { \mode_if_vertical:TF { vskip } { hskip } } }
      {
        \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
        \tl_put_left:NV \l__unravel_head_tl \l__unravel_tmpa_tl
        \__unravel_do_append_glue:
      }
      {
        \__unravel_back_input:
        \__unravel_error:nnnnn { improper-leaders } { } { } { } { }
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
      }
  }
\cs_new_protected:Npn \__unravel_do_box_explicit:N #1
  {
    \token_if_eq_meaning:NNTF \l__unravel_head_token \__unravel_hbox:w
      { \__unravel_box_hook:N \tex_everyhbox:D }
      { \__unravel_box_hook:N \tex_everyvbox:D }
      % ^^A todo: TeX calls |normal_paragraph| here.
    \__unravel_scan_spec:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_set_action_text:x
      { \tl_to_str:N \l__unravel_head_tl \iow_char:N \{ }
    \seq_push:Nf \l__unravel_leaders_box_seq
      { \bool_if:NTF #1 { \mode_if_vertical:TF { v } { h } } { Z } }
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \gtl_gconcat:NNN \g__unravel_output_gtl
      \g__unravel_output_gtl \c_group_begin_gtl
    \tl_use:N \l__unravel_head_tl
      \c_group_begin_token \__unravel_box_hook_end:
  }
\cs_new_protected:Npn \__unravel_box_hook:N #1
  {
    \tl_set:NV \l__unravel_tmpa_tl #1
    \str_if_eq:eeF
      { \tl_head:N \l__unravel_tmpa_tl } { \exp_not:N \__unravel_box_hook:w }
      {
        \__unravel_exp_args:Nx #1
          {
            \exp_not:n { \__unravel_box_hook:w \prg_do_nothing: }
            \exp_not:V #1
          }
      }
    \cs_gset_protected:Npn \__unravel_box_hook:w ##1 \__unravel_box_hook_end:
      {
        \exp_args:No #1 {##1}
        \cs_gset_eq:NN \__unravel_box_hook:w \prg_do_nothing:
        \gtl_clear:N \l__unravel_after_group_gtl
        \__unravel_print_action:
        \__unravel_back_input:o {##1}
        \__unravel_set_action_text:x
          { \token_to_meaning:N #1 = \tl_to_str:o {##1} }
        \tl_if_empty:oF {##1} { \__unravel_print_action: }
      }
  }
\cs_new_eq:NN \__unravel_box_hook:w \prg_do_nothing:
\cs_new_eq:NN \__unravel_box_hook_end: \prg_do_nothing:
\cs_new_protected:Npn \__unravel_do_leaders_rule:
  {
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_scan_alt_rule:
    \__unravel_do_leaders_fetch_skip:
  }
\prg_new_protected_conditional:Npnn \__unravel_charcode_if_safe:n #1 { TF }
  {
    \bool_if:nTF
      {
        \int_compare_p:n { #1 = `! }
        || \int_compare_p:n { `' <= #1 <= `[ }
        || \int_compare_p:n { #1 = `] }
        || \int_compare_p:n { ` ` <= #1 <= `z }
      }
      { \prg_return_true: }
      { \prg_return_false: }
  }
\cs_new_protected:Npn \__unravel_char:n #1
  {
    \tex_char:D #1 \scan_stop:
    \__unravel_charcode_if_safe:nTF {#1}
      { \tl_set:Nx \l__unravel_tmpa_tl { \char_generate:nn {#1} { 12 } } }
      {
        \tl_set:Nx \l__unravel_tmpa_tl
          { \exp_not:N \char \int_eval:n {#1} ~ }
      }
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_tmpa_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_tmpa_tl }
  }
\cs_generate_variant:Nn \__unravel_char:n { V }
\cs_new_protected:Npn \__unravel_char:x
  { \__unravel_exp_args:Nx \__unravel_char:n }
\cs_new_protected:Npn \__unravel_char_in_mmode:n #1
  {
    \int_compare:nNnTF { \tex_mathcode:D #1 } = { "8000 }
      { % math active
        \__unravel_exp_args:NNx \gtl_set:Nn \l__unravel_head_gtl
          { \char_generate:nn {#1} { 12 } }
        \__unravel_back_input:
      }
      { \__unravel_char:n {#1} }
  }
\cs_generate_variant:Nn \__unravel_char_in_mmode:n { V }
\cs_new_protected:Npn \__unravel_char_in_mmode:x
  { \__unravel_exp_args:Nx \__unravel_char_in_mmode:n }
\cs_new_protected:Npn \__unravel_mathchar:n #1
  {
    \tex_mathchar:D #1 \scan_stop:
    \tl_set:Nx \l__unravel_tmpa_tl
      { \exp_not:N \mathchar \int_eval:n {#1} ~ }
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_tmpa_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_tmpa_tl }
  }
\cs_new_protected:Npn \__unravel_mathchar:x
  { \__unravel_exp_args:Nx \__unravel_mathchar:n }
\cs_new_protected:Npn \__unravel_new_graf:N #1
  {
    \tl_set:NV \l__unravel_tmpa_tl \__unravel_everypar:w
    \__unravel_everypar:w { }
    \bool_if:NTF #1 { \tex_indent:D } { \tex_noindent:D }
    \exp_args:NV \__unravel_everypar:w \l__unravel_tmpa_tl
    \__unravel_back_input:V \l__unravel_tmpa_tl
    \__unravel_print_action:x
      {
        \g__unravel_action_text_str \c_space_tl : ~
        \token_to_str:N \everypar = { \tl_to_str:N \l__unravel_tmpa_tl }
      }
  }
\cs_new_protected:Npn \__unravel_end_graf:
  { \mode_if_horizontal:T { \__unravel_normal_paragraph: } }
\cs_new_protected:Npn \__unravel_normal_paragraph:
  {
    \tex_par:D
    \gtl_gput_right:Nn \g__unravel_output_gtl { \par }
    \__unravel_print_action:x { Paragraph~end. }
  }
\cs_new_protected:Npn \__unravel_build_page:
  {
  }
\cs_new_protected:Npn \__unravel_handle_right_brace:
  {
    \int_compare:nTF { 1 <= \__unravel_currentgrouptype: <= 13 }
      {
        \gtl_gconcat:NNN \g__unravel_output_gtl
          \g__unravel_output_gtl \c_group_end_gtl
        \__unravel_back_input_gtl:N \l__unravel_after_group_gtl
        \int_case:nn \__unravel_currentgrouptype:
          {
            { 1 } { \__unravel_end_simple_group: } % simple
            { 2 } { \__unravel_end_box_group: } % hbox
            { 3 } { \__unravel_end_box_group: } % adjusted_hbox
            { 4 } { \__unravel_end_graf: \__unravel_end_box_group: } % vbox
            { 5 } { \__unravel_end_graf: \__unravel_end_box_group: } % vtop
            { 6 } { \__unravel_end_align_group: } % align
            { 7 } { \__unravel_end_no_align_group: } % no_align
            { 8 } { \__unravel_end_output_group: } % output
            { 9 } { \__unravel_end_simple_group: } % math
            { 10 } { \__unravel_end_disc_group: } % disc
            { 11 } { \__unravel_end_graf: \__unravel_end_simple_group: } % insert
            { 12 } { \__unravel_end_graf: \__unravel_end_simple_group: } % vcenter
            { 13 } { \__unravel_end_math_choice_group: } % math_choice
          }
      }
      { % bottom_level, semi_simple, math_shift, math_left
        \l__unravel_head_token
        \__unravel_print_action:
      }
  }
\cs_new_protected:Npn \__unravel_end_simple_group:
  {
    \l__unravel_head_token
    \__unravel_print_action:
  }
\cs_new_protected:Npn \__unravel_end_box_group:
  {
    \seq_pop:NN \l__unravel_leaders_box_seq \l__unravel_tmpa_tl
    \exp_args:No \__unravel_end_box_group_aux:n { \l__unravel_tmpa_tl }
  }
\cs_new_protected:Npn \__unravel_end_box_group_aux:n #1
  {
    \str_if_eq:eeTF {#1} { Z }
      { \__unravel_end_simple_group: }
      {
        \__unravel_get_x_non_relax:
        \__unravel_set_cmd:
        \int_compare:nNnTF \l__unravel_head_cmd_int
          = { \__unravel_tex_use:n { #1 skip } }
          {
            \tl_put_left:Nn \l__unravel_head_tl { \c_group_end_token }
            \__unravel_do_append_glue:
          }
          {
            \__unravel_back_input:
            \c_group_end_token \group_begin: \group_end:
            \__unravel_print_action:
          }
      }
  }
\cs_new_protected:Npn \__unravel_off_save:
  {
    \int_compare:nNnTF \__unravel_currentgrouptype: = { 0 }
      { % bottom-level
        \__unravel_error:nxxxx { extra-close }
          { \token_to_meaning:N \l__unravel_head_token } { } { } { }
      }
      {
        \__unravel_back_input:
        \int_case:nnF \__unravel_currentgrouptype:
          {
            { 14 } % semi_simple_group
              { \gtl_set:Nn \l__unravel_head_gtl { \group_end: } }
            { 15 } % math_shift_group
              { \gtl_set:Nn \l__unravel_head_gtl { $ } } % $
            { 16 } % math_left_group
              { \gtl_set:Nn \l__unravel_head_gtl { \tex_right:D . } }
          }
          { \gtl_set_eq:NN \l__unravel_head_gtl \c_group_end_gtl }
        \__unravel_back_input:
        \__unravel_error:nxxxx { off-save }
          { \gtl_to_str:N \l__unravel_head_gtl } { } { } { }
      }
  }
\cs_new_protected:Npn \__unravel_mode_math:n #1
  { \mode_if_math:TF {#1} { \__unravel_insert_dollar_error: } }
\cs_new_protected:Npn \__unravel_mode_non_math:n #1
  { \mode_if_math:TF { \__unravel_insert_dollar_error: } {#1} }
\cs_new_protected:Npn \__unravel_mode_vertical:n #1
  {
    \mode_if_math:TF
      { \__unravel_insert_dollar_error: }
      { \mode_if_horizontal:TF { \__unravel_head_for_vmode: } {#1} }
  }
\cs_new_protected:Npn \__unravel_mode_non_vertical:n #1
  {
    \mode_if_vertical:TF
      { \__unravel_back_input: \__unravel_new_graf:N \c_true_bool }
      {#1}
  }
\cs_new_protected:Npn \__unravel_head_for_vmode:
  {
    \mode_if_inner:TF
      {
        \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_hrule:D
          {
            \__unravel_error:nnnnn { hrule-bad-mode } { } { } { } { }
            \__unravel_print_action:
          }
          { \__unravel_off_save: }
      }
      {
        \__unravel_back_input:
        \gtl_set:Nn \l__unravel_head_gtl { \par }
        \__unravel_back_input:
      }
  }
\cs_new_protected:Npn \__unravel_goto_inner_math:
  {
    \__unravel_box_hook:N \tex_everymath:D
    $ % $
    \__unravel_box_hook_end:
  }
\cs_new_protected:Npn \__unravel_goto_display_math:
  {
    \__unravel_box_hook:N \tex_everydisplay:D
    $ $
    \__unravel_box_hook_end:
  }
\cs_new_protected:Npn \__unravel_after_math:
  {
    \mode_if_inner:TF
      {
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \__unravel_back_input_gtl:N \l__unravel_after_group_gtl
        $ % $
      }
      {
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \__unravel_get_x_next:
        \token_if_eq_catcode:NNF
          \l__unravel_head_token \c_math_toggle_token
          {
            \__unravel_back_input:
            \tl_set:Nn \l__unravel_head_tl { $ } % $
            \__unravel_error:nnnnn { missing-dollar } { } { } { } { }
          }
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \__unravel_back_input_gtl:N \l__unravel_after_group_gtl
        $ $
      }
    \__unravel_print_action:
  }
\cs_new_protected:Npn \__unravel_do_step:
  {
    \__unravel_set_action_text:
    \bool_if:NT \g__unravel_internal_debug_bool
      { \__unravel_exp_args:Nx \iow_term:n { Cmd:~\int_to_arabic:n { \l__unravel_head_cmd_int } } }
    \cs_if_exist_use:cF
      { __unravel_cmd_ \int_use:N \l__unravel_head_cmd_int : }
      { \__unravel_error:nxxxx { internal } { unknown-command } { } { } { } }
  }
\__unravel_new_tex_cmd:nn { relax }                                % 0
  {
    \token_if_eq_meaning:NNT \l__unravel_head_token \__unravel_special_relax:
      {
        \exp_after:wN \__unravel_token_if_expandable:NTF \l__unravel_head_tl
          {
            \__unravel_set_action_text:x
              { \iow_char:N \\notexpanded: \g__unravel_action_text_str }
          }
          { }
      }
    \__unravel_print_action:
  }
\__unravel_new_tex_cmd:nn { begin-group_char }                     % 1
  {
    \gtl_gconcat:NNN \g__unravel_output_gtl
      \g__unravel_output_gtl \c_group_begin_gtl
    \__unravel_print_action:
    \l__unravel_head_token
    \gtl_clear:N \l__unravel_after_group_gtl
  }
\__unravel_new_tex_cmd:nn { end-group_char }                       % 2
  { \__unravel_handle_right_brace: }
\__unravel_new_tex_cmd:nn { math_char }                            % 3
  {
    \__unravel_mode_non_vertical:n
      {
        \mode_if_math:TF
          {
            \int_compare:nNnTF
              \__unravel_currentgrouptype: = { 15 } % math_shift_group
              { \__unravel_after_math: }
              { \__unravel_off_save: }
          }
          {
            \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
            \__unravel_get_next:
            \token_if_eq_catcode:NNTF
              \l__unravel_head_token \c_math_toggle_token
              {
                \mode_if_inner:TF
                  { \__unravel_back_input: \__unravel_goto_inner_math: }
                  {
                    \gtl_gput_right:NV
                      \g__unravel_output_gtl \l__unravel_head_tl
                    \__unravel_goto_display_math:
                  }
              }
              { \__unravel_back_input: \__unravel_goto_inner_math: }
          }
      }
  }
\__unravel_new_tex_cmd:nn { alignment_char }                       % 4
  { \l__unravel_head_token \__unravel_print_action: }
\__unravel_new_tex_cmd:nn { car_ret }                              % 5
  { \l__unravel_head_token \__unravel_print_action: }
\__unravel_new_tex_cmd:nn { macro_char }                           % 6
  { \l__unravel_head_token \__unravel_print_action: }
\__unravel_new_tex_cmd:nn { superscript_char }                     % 7
  { \__unravel_mode_math:n { \__unravel_sub_sup: } }
\__unravel_new_tex_cmd:nn { subscript_char }                       % 8
  { \__unravel_mode_math:n { \__unravel_sub_sup: } }
\cs_new_protected:Npn \__unravel_sub_sup:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_get_x_non_relax:
    \__unravel_set_cmd:
    \int_case:nnTF \l__unravel_head_cmd_int
      {
        { \__unravel_tex_use:n { the_char } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { other_char } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { char_given } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { char_num } }
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_int:
          }
        { \__unravel_tex_use:n { math_char_num } }
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_int:
          }
        { \__unravel_tex_use:n { math_given } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
        { \__unravel_tex_use:n { delim_num } }
          { \__unravel_prev_input:V \l__unravel_head_tl \__unravel_scan_int: }
      }
      {
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \tl_use:N \l__unravel_head_tl \scan_stop:
      }
      {
        \__unravel_back_input:
        \__unravel_scan_left_brace:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \gtl_gconcat:NNN \g__unravel_output_gtl
          \g__unravel_output_gtl \c_group_begin_gtl
        \tl_use:N \l__unravel_head_tl \c_group_begin_token
      }
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { endv }                                 % 9
  { \__unravel_not_implemented:n { alignments } }
\__unravel_new_tex_cmd:nn { blank_char }                           % 10
  {
    \mode_if_horizontal:T
      {
        \gtl_gput_right:Nn \g__unravel_output_gtl { ~ }
        \l__unravel_head_token
      }
    \__unravel_print_action:
  }
\__unravel_new_tex_cmd:nn { the_char }                             % 11
  {
    \__unravel_mode_non_vertical:n
      {
        \tl_set:Nx \l__unravel_tmpa_tl
          { ` \__unravel_token_to_char:N \l__unravel_head_token }
        \mode_if_math:TF
          { \__unravel_char_in_mmode:V \l__unravel_tmpa_tl }
          { \__unravel_char:V \l__unravel_tmpa_tl }
      }
  }
\__unravel_new_eq_tex_cmd:nn { other_char } { the_char }           % 12
\__unravel_new_tex_cmd:nn { par_end }                              % 13
  {
    \__unravel_mode_non_math:n
      {
        \mode_if_vertical:TF
          { \__unravel_normal_paragraph: }
          {
            % if align_state<0 then off_save;
            \__unravel_end_graf:
            \mode_if_vertical:T
              { \mode_if_inner:F { \__unravel_build_page: } }
          }
      }
  }
\__unravel_new_tex_cmd:nn { stop }                                 % 14
  {
    \__unravel_mode_vertical:n
      {
        \mode_if_inner:TF
          { \__unravel_forbidden_case: }
          {
            % ^^A todo: unless its_all_over
            \int_gdecr:N \g__unravel_ends_int
            \int_compare:nNnTF \g__unravel_ends_int > 0
              {
                \__unravel_back_input:
                \__unravel_back_input:n
                  {
                    \__unravel_hbox:w to \tex_hsize:D { }
                    \tex_vfill:D
                    \tex_penalty:D - '10000000000 ~
                  }
                \__unravel_build_page:
                \__unravel_print_action:x { End~everything! }
              }
              {
                \__unravel_print_outcome:
                \l__unravel_head_token
              }
          }
      }
  }
\__unravel_new_tex_cmd:nn { delim_num }                            % 15
  {
    \__unravel_mode_math:n
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \__unravel_scan_int:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \tl_use:N \l__unravel_head_tl \scan_stop:
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
      }
  }
\__unravel_new_tex_cmd:nn { char_num }                             % 16
  {
    \__unravel_mode_non_vertical:n
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \__unravel_scan_int:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \mode_if_math:TF
          { \__unravel_char_in_mmode:x { \tl_tail:N \l__unravel_head_tl } }
          { \__unravel_char:x { \tl_tail:N \l__unravel_head_tl } }
      }
  }
\__unravel_new_tex_cmd:nn { math_char_num }                        % 17
  {
    \__unravel_mode_math:n
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \__unravel_scan_int:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_mathchar:x { \tl_tail:N \l__unravel_head_tl }
      }
  }
\__unravel_new_tex_cmd:nn { mark }                                 % 18
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \int_compare:nNnF \l__unravel_head_char_int = 0
      { \__unravel_scan_int: }
    \__unravel_prev_input_gpush:
    \__unravel_scan_toks:NN \c_false_bool \c_true_bool
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_print_action:x
      { \tl_to_str:N \l__unravel_head_tl \tl_to_str:N \l__unravel_tmpa_tl }
    \tl_put_right:Nx \l__unravel_head_tl
      { { \exp_not:N \exp_not:n \exp_not:V \l__unravel_tmpa_tl } }
    \tl_use:N \l__unravel_head_tl
  }
\__unravel_new_tex_cmd:nn { xray }                                 % 19
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \int_case:nnF \l__unravel_head_char_int
      {
        { 0 }
          { % show
            \__unravel_get_next:
            \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
            \token_if_eq_meaning:NNTF
              \l__unravel_head_token \__unravel_special_relax:
              {
                \exp_after:wN \exp_after:wN \exp_after:wN \l__unravel_tmpa_tl
                \exp_after:wN \exp_not:N \l__unravel_head_tl
              }
              { \gtl_head_do:NN \l__unravel_head_gtl \l__unravel_tmpa_tl }
          }
        { 2 }
          { % showthe
            \__unravel_get_x_next:
            \__unravel_scan_something_internal:n { 5 }
            \__unravel_prev_input_gpop:N \l__unravel_head_tl
            \__unravel_exp_args:Nx \use:n
              { \tex_showtokens:D { \tl_tail:N \l__unravel_head_tl } }
          }
      }
      { % no operand for showlists, showgroups, showifs
        \int_compare:nNnT \l__unravel_head_char_int = 1 % showbox
          { \__unravel_scan_int: }
        \int_compare:nNnT \l__unravel_head_char_int = 5 % showtokens
          { \__unravel_scan_toks:NN \c_false_bool \c_false_bool }
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \tl_use:N \l__unravel_head_tl \scan_stop:
      }
  }
\__unravel_new_tex_cmd:nn { make_box }                             % 20
  {
    \__unravel_prev_input_gpush:
    \__unravel_back_input:
    \__unravel_do_box:N \c_false_bool
  }
\cs_new_protected:Npn \__unravel_do_move:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_normal_dimen:
    \__unravel_do_box:N \c_false_bool
  }
\__unravel_new_tex_cmd:nn { hmove }                                % 21
  {
    \mode_if_vertical:TF
      { \__unravel_do_move: } { \__unravel_forbidden_case: }
  }
\__unravel_new_tex_cmd:nn { vmove }                                % 22
  {
    \mode_if_vertical:TF
      { \__unravel_forbidden_case: } { \__unravel_do_move: }
  }
\cs_new_protected:Npn \__unravel_do_unpackage:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_int:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { un_hbox }                              % 23
  { \__unravel_mode_non_vertical:n { \__unravel_do_unpackage: } }
\__unravel_new_tex_cmd:nn { un_vbox }                              % 24
  {
    \__unravel_mode_vertical:n
      {
        \int_compare:nNnTF \l__unravel_head_char_int > { 1 }
          { \l__unravel_head_token \__unravel_print_action: }
          { \__unravel_do_unpackage: }
      }
  }
\__unravel_new_tex_cmd:nn { remove_item }                          % 25
  { \l__unravel_head_token \__unravel_print_action: }
\cs_new_protected:Npn \__unravel_do_append_glue:
  {
    \int_compare:nNnTF \l__unravel_head_char_int < { 4 }
      { \tl_use:N \l__unravel_head_tl \__unravel_print_action: }
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \exp_args:Nf \__unravel_scan_glue:n
          { \int_eval:n { \l__unravel_head_char_int - 2 } }
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \tl_use:N \l__unravel_head_tl \scan_stop:
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
      }
  }
\__unravel_new_tex_cmd:nn { hskip }                                % 26
  { \__unravel_mode_non_vertical:n { \__unravel_do_append_glue: } }
\__unravel_new_tex_cmd:nn { vskip }                                % 27
  { \__unravel_mode_vertical:n { \__unravel_do_append_glue: } }
\__unravel_new_tex_cmd:nn { mskip }                                % 28
  { \__unravel_mode_math:n { \__unravel_do_append_glue: } }
\cs_new_protected:Npn \__unravel_do_append_kern:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_kern:D
      { \__unravel_scan_dimen:nN { 2 } \c_false_bool }
      { \__unravel_scan_dimen:nN { 3 } \c_false_bool }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { kern }                                 % 29
  { \__unravel_do_append_kern: }
\__unravel_new_tex_cmd:nn { mkern }                                % 30
  { \__unravel_mode_math:n { \__unravel_do_append_kern: } }
\__unravel_new_tex_cmd:nn { leader_ship }                          % 31
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_do_box:N \c_true_bool
  }
\__unravel_new_tex_cmd:nn { halign }                               % 32
  { \__unravel_not_implemented:n { halign } }
\__unravel_new_tex_cmd:nn { valign }                               % 33
  { \__unravel_not_implemented:n { valign } }
\__unravel_new_tex_cmd:nn { no_align }                             % 34
  { \__unravel_not_implemented:n { noalign } }
\__unravel_new_tex_cmd:nn { vrule }                                % 35
  { \__unravel_mode_non_vertical:n { \__unravel_do_rule: } }
\__unravel_new_tex_cmd:nn { hrule }                                % 36
  { \__unravel_mode_vertical:n { \__unravel_do_rule: } }
\cs_new_protected:Npn \__unravel_do_rule:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_alt_rule:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { insert }                               % 37
  { \__unravel_begin_insert_or_adjust: }
\__unravel_new_tex_cmd:nn { vadjust }                              % 38
  {
    \mode_if_vertical:TF
      { \__unravel_forbidden_case: } { \__unravel_begin_insert_or_adjust: }
  }
\__unravel_new_tex_cmd:nn { ignore_spaces }                        % 39
  {
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_ignorespaces:D
      {
        \__unravel_print_action:
        \__unravel_get_x_non_blank:
        \__unravel_set_cmd:
        \__unravel_do_step:
      }
      { \__unravel_not_implemented:n { pdfprimitive } }
  }
\__unravel_new_tex_cmd:nn { after_assignment }                     % 40
  {
    \tl_set_eq:NN \l__unravel_tmpa_tl \l__unravel_head_tl
    \__unravel_get_next:
    \gtl_gset_eq:NN \g__unravel_after_assignment_gtl \l__unravel_head_gtl
    \__unravel_print_action:x
      {
        Afterassignment:~\tl_to_str:N \l__unravel_tmpa_tl
        \gtl_to_str:N \l__unravel_head_gtl
      }
  }
\__unravel_new_tex_cmd:nn { after_group }                          % 41
  {
    \tl_set_eq:NN \l__unravel_tmpa_tl \l__unravel_head_tl
    \__unravel_get_next:
    \int_compare:nNnTF \__unravel_currentgrouptype: = 0
      {
        \__unravel_print_action:x
          {
            Aftergroup~(level~0~=>~dropped):~
            \tl_to_str:N \l__unravel_tmpa_tl
            \gtl_to_str:N \l__unravel_head_gtl
          }
      }
      {
        \gtl_concat:NNN \l__unravel_after_group_gtl
          \l__unravel_after_group_gtl \l__unravel_head_gtl
        \__unravel_print_action:x
          {
            Aftergroup:~\tl_to_str:N \l__unravel_tmpa_tl
            \gtl_to_str:N \l__unravel_head_gtl
          }
      }
  }
\__unravel_new_tex_cmd:nn { break_penalty }                        % 42
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_int:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { start_par }                            % 43
  {
    \mode_if_vertical:TF
      {
        \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_noindent:D
          { \__unravel_new_graf:N \c_false_bool }
          { \__unravel_new_graf:N \c_true_bool }
      }
      {
        \int_compare:nNnT \l__unravel_head_char_int = { 1 } % indent
          {
            \__unravel_hbox:w width \tex_parindent:D { }
            \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
          }
        \__unravel_print_action:
      }
  }
\__unravel_new_tex_cmd:nn { ital_corr }                            % 44
  {
    \mode_if_vertical:TF { \__unravel_forbidden_case: }
      { \l__unravel_head_token \__unravel_print_action: }
  }
\cs_new_protected:Npn \__unravel_do_accent:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_int:
    \__unravel_do_assignments:
    \bool_if:nTF
      {
        \token_if_eq_catcode_p:NN
          \l__unravel_head_token \c_catcode_letter_token
        ||
        \token_if_eq_catcode_p:NN
          \l__unravel_head_token \c_catcode_other_token
        ||
        \int_compare_p:nNn
          \l__unravel_head_cmd_int = { \__unravel_tex_use:n { char_given } }
      }
      { \__unravel_prev_input:V \l__unravel_head_tl }
      {
        \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_char:D
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \__unravel_scan_int:
          }
          { \__unravel_break:w }
      }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_break_point:
  }
\cs_new_protected:Npn \__unravel_do_math_accent:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_int:
    \__unravel_scan_math:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { accent }                               % 45
  {
    \__unravel_mode_non_vertical:n
      {
        \mode_if_math:TF
          { \__unravel_do_math_accent: } { \__unravel_do_accent: }
      }
  }
\__unravel_new_tex_cmd:nn { math_accent }                          % 46
  { \__unravel_mode_math:n { \__unravel_do_math_accent: } }
\__unravel_new_tex_cmd:nn { discretionary }                        % 47
  { \__unravel_not_implemented:n { discretionary } }
\__unravel_new_tex_cmd:nn { eq_no }                                % 48
  { \__unravel_not_implemented:n { eqno } }
\__unravel_new_tex_cmd:nn { left_right }                           % 49
  { \__unravel_not_implemented:n { left/right } }
\__unravel_new_tex_cmd:nn { math_comp }                            % 50
  { \__unravel_not_implemented:n { math~comp } }
\__unravel_new_tex_cmd:nn { limit_switch }                         % 51
  { \__unravel_not_implemented:n { limits } }
\__unravel_new_tex_cmd:nn { above }                                % 52
  { \__unravel_not_implemented:n { above } }
\__unravel_new_tex_cmd:nn { math_style }                           % 53
  { \__unravel_not_implemented:n { math~style } }
\__unravel_new_tex_cmd:nn { math_choice }                          % 54
  { \__unravel_not_implemented:n { math~choice } }
\__unravel_new_tex_cmd:nn { non_script }                           % 55
  { \__unravel_not_implemented:n { non~script } }
\__unravel_new_tex_cmd:nn { vcenter }                              % 56
  { \__unravel_not_implemented:n { vcenter } }
\__unravel_new_tex_cmd:nn { case_shift }                           % 57
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_scan_toks:NN \c_false_bool \c_false_bool
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \exp_after:wN \__unravel_case_shift:Nn \l__unravel_tmpa_tl
  }
\cs_new_protected:Npn \__unravel_case_shift:Nn #1#2
  {
    #1 { \__unravel_back_input:n {#2} }
    \__unravel_print_action:x
      { \token_to_meaning:N #1 ~ \tl_to_str:n { {#2} } }
  }
\__unravel_new_tex_cmd:nn { message }                              % 58
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_toks_to_str:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { extension }                            % 59
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_scan_extension_operands:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { in_stream }                            % 60
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_action:
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_openin:D
      {
        \__unravel_scan_int:
        \__unravel_scan_optional_equals:
        \__unravel_scan_file_name:
      }
      { \__unravel_scan_int: }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_cmd:nn { begin_group }                          % 61
  {
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \l__unravel_head_token
    \gtl_clear:N \l__unravel_after_group_gtl
    \__unravel_print_action:
  }
\__unravel_new_tex_cmd:nn { end_group }                            % 62
  {
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \__unravel_back_input_gtl:N \l__unravel_after_group_gtl
    \l__unravel_head_token
    \__unravel_print_action:
  }
\__unravel_new_tex_cmd:nn { omit }                                 % 63
  { \__unravel_not_implemented:n { omit } }
\__unravel_new_tex_cmd:nn { ex_space }                             % 64
  {
    \__unravel_mode_non_vertical:n
      { \l__unravel_head_token \__unravel_print_action: }
  }
\__unravel_new_tex_cmd:nn { no_boundary }                          % 65
  {
    \__unravel_mode_non_vertical:n
      { \l__unravel_head_token \__unravel_print_action: }
  }
\__unravel_new_tex_cmd:nn { radical }                              % 66
  {
    \__unravel_mode_math:n
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \__unravel_scan_int:
        \__unravel_scan_math:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
        \tl_use:N \l__unravel_head_tl \scan_stop:
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
      }
  }
\__unravel_new_tex_cmd:nn { end_cs_name }                          % 67
  {
    \__unravel_tex_error:nV { extra-endcsname } \l__unravel_head_tl
    \__unravel_print_action:
  }
\__unravel_new_tex_cmd:nn { char_given }                           % 68
  {
    \__unravel_mode_non_vertical:n
      {
        \mode_if_math:TF
          { \__unravel_char_in_mmode:V \l__unravel_head_char_int }
          { \__unravel_char:V \l__unravel_head_char_int }
      }
  }
\__unravel_new_tex_cmd:nn { math_given }                           % 69
  {
    \__unravel_mode_math:n
      { \__unravel_mathchar:x { \int_use:N \l__unravel_head_char_int } }
  }
\__unravel_new_tex_cmd:nn { last_item }                            % 70
  { \__unravel_forbidden_case: }
\cs_new_protected:Npn \__unravel_scan_extension_operands:
  {
    \int_case:nnF \l__unravel_head_char_int
      {
        { 0 } % openout
          {
            \__unravel_scan_int:
            \__unravel_scan_optional_equals:
            \__unravel_scan_file_name:
          }
        { 1 } % write
          {
            \__unravel_scan_int:
            \__unravel_scan_toks:NN \c_false_bool \c_false_bool
          }
        { 2 } % closeout
          { \__unravel_scan_int: }
        { 3 } % special
          { \__unravel_scan_toks_to_str: }
        { 4 } % immediate
          { \__unravel_scan_immediate_operands: }
        { 5 } % setlanguage
          {
            \mode_if_horizontal:TF
              { \__unravel_scan_int: }
              { \__unravel_error:nnnnn { invalid-mode } { } { } { } { } }
          }
        { 6 } % pdfliteral
          {
            \__unravel_scan_keyword:nF { dDiIrReEcCtT }
              { \__unravel_scan_keyword:n { pPaAgGeE } }
            \__unravel_scan_pdf_ext_toks:
          }
        { 7 } % pdfobj
          {
            \__unravel_scan_keyword:nTF
              { rReEsSeErRvVeEoObBjJnNuUmM }
              { \__unravel_skip_optional_space: }
              {
                \__unravel_scan_keyword:nF { uUsSeEoObBjJnNuUmM }
                  { \__unravel_scan_int: }
                \__unravel_scan_keyword:nT { sStTrReEaAmM }
                  {
                    \__unravel_scan_keyword:nT { aAtTtTrR }
                      { \__unravel_scan_pdf_ext_toks: }
                  }
                \__unravel_scan_keyword:n { fFiIlLeE }
                \__unravel_scan_pdf_ext_toks:
              }
          }
        { 8 } % pdfrefobj
          { \__unravel_scan_int: }
        { 9 } % pdfxform
          {
            \__unravel_scan_keyword:nT { aAtTtTrR }
              { \__unravel_scan_pdf_ext_toks: }
            \__unravel_scan_keyword:nTF { rReEsSoOuUrRcCeEsS }
              { \__unravel_scan_pdf_ext_toks: }
            \__unravel_scan_int:
          }
        { 10 } % pdfrefxform
          { \__unravel_scan_int: }
        { 11 } % pdfximage
          { \__unravel_scan_image: }
        { 12 } % pdfrefximage
          { \__unravel_scan_int: }
        { 13 } % pdfannot
          {
            \__unravel_scan_keyword:nTF
              { rReEsSeErRvVeEoObBjJnNuUmM }
              { \__unravel_scan_optional_space: }
              {
                \__unravel_scan_keyword:nT { uUsSeEoObBjJnNuUmM }
                  { \__unravel_scan_int: }
                \__unravel_scan_alt_rule:
                \__unravel_scan_pdf_ext_toks:
              }
          }
        { 14 } % pdfstartlink
          {
            \mode_if_vertical:TF
              { \__unravel_error:nnnnn { invalid-mode } { } { } { } { } }
              {
                \__unravel_scan_rule_attr:
                \__unravel_scan_action:
              }
          }
        { 15 } % pdfendlink
          {
            \mode_if_vertical:T
              { \__unravel_error:nnnnn { invalid-mode } { } { } { } { } }
          }
        { 16 } % pdfoutline
          {
            \__unravel_scan_keyword:nT { aAtTtTrR }
              { \__unravel_scan_pdf_ext_toks: }
            \__unravel_scan_action:
            \__unravel_scan_keyword:nT { cCoOuUnNtT }
              { \__unravel_scan_int: }
            \__unravel_scan_pdf_ext_toks:
          }
        { 17 } % pdfdest
          { \__unravel_scan_pdfdest_operands: }
        { 18 } % pdfthread
          { \__unravel_scan_rule_attr: \__unravel_scan_thread_id: }
        { 19 } % pdfstartthread
          { \__unravel_scan_rule_attr: \__unravel_scan_thread_id: }
        { 20 } % pdfendthread
          { }
        { 21 } % pdfsavepos
          { }
        { 22 } % pdfinfo
          { \__unravel_scan_pdf_ext_toks: }
        { 23 } % pdfcatalog
          {
            \__unravel_scan_pdf_ext_toks:
            \__unravel_scan_keyword:n { oOpPeEnNaAcCtTiIoOnN }
              { \__unravel_scan_action: }
          }
        { 24 } % pdfnames
          { \__unravel_scan_pdf_ext_toks: }
        { 25 } % pdffontattr
          {
            \__unravel_scan_font_ident:
            \__unravel_scan_pdf_ext_toks:
          }
        { 26 } % pdfincludechars
          {
            \__unravel_scan_font_ident:
            \__unravel_scan_pdf_ext_toks:
          }
        { 27 } % pdfmapfile
          { \__unravel_scan_pdf_ext_toks: }
        { 28 } % pdfmapline
          { \__unravel_scan_pdf_ext_toks: }
        { 29 } % pdftrailer
          { \__unravel_scan_pdf_ext_toks: }
        { 30 } % pdfresettimer
          { }
        { 31 } % pdffontexpand
          {
            \__unravel_scan_font_ident:
            \__unravel_scan_optional_equals:
            \__unravel_scan_int:
            \__unravel_scan_int:
            \__unravel_scan_int:
            \__unravel_scan_keyword:nT { aAuUtToOeExXpPaAnNdD }
              { \__unravel_skip_optional_space: }
          }
        { 32 } % pdfsetrandomseed
          { \__unravel_scan_int: }
        { 33 } % pdfsnaprefpoint
          { }
        { 34 } % pdfsnapy
          { \__unravel_scan_normal_glue: }
        { 35 } % pdfsnapycomp
          { \__unravel_scan_int: }
        { 36 } % pdfglyphtounicode
          {
            \__unravel_scan_pdf_ext_toks:
            \__unravel_scan_pdf_ext_toks:
          }
        { 37 } % pdfcolorstack
          { \__unravel_scan_pdfcolorstack_operands: }
        { 38 } % pdfsetmatrix
          { \__unravel_scan_pdf_ext_toks: }
        { 39 } % pdfsave
          { }
        { 40 } % pdfrestore
          { }
        { 41 } % pdfnobuiltintounicode
          { \__unravel_scan_font_ident: }
      }
      { } % no other cases.
  }
\cs_new_protected:Npn \__unravel_scan_pdfcolorstack_operands:
  {
    \__unravel_scan_int:
    \__unravel_scan_keyword:nF { sSeEtT }
      {
        \__unravel_scan_keyword:nF { pPuUsShH }
          {
            \__unravel_scan_keyword:nF { pPoOpP }
              {
                \__unravel_scan_keyword:nF { cCuUrRrReEnNtT }
                  {
                    \__unravel_error:nnnnn { color-stack-action-missing }
                      { } { } { } { }
                  }
              }
          }
      }
  }
\cs_new_protected:Npn \__unravel_scan_rule_attr:
  {
    \__unravel_scan_alt_rule:
    \__unravel_scan_keyword:nT { aAtTtTrR }
      { \__unravel_scan_pdf_ext_toks: }
  }
\cs_new_protected:Npn \__unravel_scan_action:
  {
    \__unravel_scan_keyword:nTF { uUsSeErR }
      { \__unravel_scan_pdf_ext_toks: }
      {
        \__unravel_scan_keyword:nF { gGoOtToO }
          {
            \__unravel_scan_keyword:nF { tThHrReEaAdD }
              { \__unravel_error:nnnnn { action-type-missing } { } { } { } { } }
          }
      }
    \__unravel_scan_keyword:nT { fFiIlLeE }
      { \__unravel_scan_pdf_ext_toks: }
    \__unravel_scan_keyword:nTF { pPaAgGeE }
      {
        \__unravel_scan_int:
        \__unravel_scan_pdf_ext_toks:
      }
      {
        \__unravel_scan_keyword:nTF { nNaAmMeE }
          { \__unravel_scan_pdf_ext_toks: }
          {
            \__unravel_scan_keyword:nTF { nNuUmM }
              { \__unravel_scan_int: }
              { \__unravel_error:nnnnn { identifier-type-missing } { } { } { } { } }
          }
      }
    \__unravel_scan_keyword:nTF { nNeEwWwWiInNdDoOwW }
      { \__unravel_skip_optional_space: }
      {
        \__unravel_scan_keyword:nT { nNoOnNeEwWwWiInNdDoOwW }
          { \__unravel_skip_optional_space: }
      }
  }
\cs_new_protected:Npn \__unravel_scan_image:
  {
    \__unravel_scan_rule_attr:
    \__unravel_scan_keyword:nTF { nNaAmMeEdD }
      { \__unravel_scan_pdf_ext_toks: }
      {
        \__unravel_scan_keyword:nT { pPaAgGeE }
          { \__unravel_scan_int: }
      }
    \__unravel_scan_keyword:nT { cCoOlLoOrRsSpPaAcCeE }
      { \__unravel_scan_int: }
    \__unravel_scan_pdf_ext_toks:
  }
\cs_new_protected:Npn \__unravel_scan_immediate_operands:
  {
    \__unravel_get_x_next:
    \__unravel_set_cmd:
    \int_compare:nNnTF
      \l__unravel_head_cmd_int = { \__unravel_tex_use:n { extension } }
      {
        \int_compare:nNnTF
          \l__unravel_head_char_int < { 3 } % openout, write, closeout
          { \__unravel_scan_immediate_operands_aux: }
          {
            \int_case:nnF \l__unravel_head_char_int
              {
                { 7 } { \__unravel_scan_extension_operands_aux: } % pdfobj
                { 9 } { \__unravel_scan_extension_operands_aux: } % pdfxform
                { 11 } { \__unravel_scan_extension_operands_aux: } %pdfximage
              }
              { \__unravel_scan_immediate_operands_bad: }
          }
      }
      { \__unravel_scan_immediate_operands_bad: }
  }
\cs_new_protected:Npn \__unravel_scan_immediate_operands_aux:
  {
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_scan_extension_operands:
  }
\cs_new_protected:Npn \__unravel_scan_immediate_operands_bad:
  {
    \__unravel_back_input:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl ignored }
    \__unravel_prev_input_gpush:
  }

\cs_new_protected:Npn \__unravel_scan_pdfdest_operands:
  {
    \__unravel_scan_keyword:nTF { nNuUmM }
      { \__unravel_scan_int: }
      {
        \__unravel_scan_keyword:nTF { nNaAmMeE }
          { \__unravel_scan_pdf_ext_toks: }
          { \__unravel_error:nnnnn { identifier-type-missing } { } { } { } { } }
      }
    \__unravel_scan_keyword:nTF { xXyYzZ }
      {
        \__unravel_scan_keyword:nT { zZoOoOmM }
          { \__unravel_scan_int: }
      }
      {
        \__unravel_scan_keyword:nF { fFiItTbBhH }
          {
            \__unravel_scan_keyword:nF { fFiItTbBvV }
              {
                \__unravel_scan_keyword:nF { fFiItTbB }
                  {
                    \__unravel_scan_keyword:nF { fFiItThHhH }
                      {
                        \__unravel_scan_keyword:nF { fFiItTvV }
                          {
                            \__unravel_scan_keyword:nTF
                              { fFiItTrR }
                              {
                                \__unravel_skip_optional_space:
                                \__unravel_scan_alt_rule:
                                \use_none:n
                              }
                              {
                                \__unravel_scan_keyword:nF
                                  { fFiItT }
                                  {
                                    \__unravel_error:nnnnn { destination-type-missing }
                                      { } { } { } { }
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
    \__unravel_skip_optional_space:
  }
\cs_set_protected:Npn \__unravel_tmp:w
  {
    \__unravel_prev_input_gpush:
    \__unravel_prefixed_command:
  }
\int_step_inline:nnnn
  { \__unravel_tex_use:n { max_non_prefixed_command } + 1 }
  { 1 }
  { \__unravel_tex_use:n { max_command } }
  { \cs_new_eq:cN { __unravel_cmd_#1: } \__unravel_tmp:w }
\cs_new_protected:Npn \__unravel_prefixed_command:
  {
    \int_while_do:nNnn
      \l__unravel_head_cmd_int = { \__unravel_tex_use:n { prefix } }
      {
        \__unravel_prev_input:V \l__unravel_head_tl
        \__unravel_get_x_non_relax:
        \__unravel_set_cmd:
        \int_compare:nNnF \l__unravel_head_cmd_int
          > { \__unravel_tex_use:n { max_non_prefixed_command } }
          {
            \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
            \__unravel_error:nxxxx { erroneous-prefixes }
              { \tl_to_str:N \l__unravel_tmpa_tl }
              { \tl_to_str:N l__unravel_head_tl }
              { } { }
            \__unravel_back_input:
            \__unravel_omit_after_assignment:w
          }
      }
    % ^^A todo: Discard non-\global prefixes if they are irrelevant
    % ^^A todo: Adjust for the setting of \globaldefs
    \cs_if_exist_use:cF
      { __unravel_prefixed_ \int_use:N \l__unravel_head_cmd_int : }
      {
        \__unravel_error:nnnnn { internal } { prefixed } { } { } { }
        \__unravel_omit_after_assignment:w
      }
    \__unravel_after_assignment:
  }
\cs_new_protected:Npn \__unravel_after_assignment:
  {
    \__unravel_back_input_gtl:N \g__unravel_after_assignment_gtl
    \gtl_gclear:N \g__unravel_after_assignment_gtl
  }
\cs_new_protected:Npn \__unravel_omit_after_assignment:w
    #1 \__unravel_after_assignment: { }
\cs_new_protected:Npn \__unravel_prefixed_new:nn #1#2
  {
    \cs_new_protected:cpn
      { __unravel_prefixed_ \__unravel_tex_use:n {#1} : } {#2}
  }
\cs_new_protected:Npn \__unravel_assign_token:n #1
  {
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    #1
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_assigned_token:
  }
\cs_new_protected:Npn \__unravel_assign_register:
  {
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_assigned_register:
  }
\cs_new_protected:Npn \__unravel_assign_value:nn #1#2
  {
    \tl_if_empty:nF {#1}
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
        #1
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
      }
    \__unravel_prev_input:V \l__unravel_head_tl
    \tl_set_eq:NN \l__unravel_defined_tl \l__unravel_head_tl
    \__unravel_scan_optional_equals:
    #2
    \__unravel_assign_register:
  }
\__unravel_prefixed_new:nn { toks_register }                       % 71
  {
    \int_compare:nNnT \l__unravel_head_char_int = 0
      { % \toks
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_action:
        \__unravel_scan_int:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
      }
    \__unravel_assign_toks:
  }
\__unravel_prefixed_new:nn { assign_toks }                         % 72
  { \__unravel_assign_toks: }
\cs_new_protected:Npn \__unravel_assign_toks:
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_print_action:
    \tl_set_eq:NN \l__unravel_defined_tl \l__unravel_head_tl
    \__unravel_scan_optional_equals:
    \__unravel_get_x_non_relax:
    \__unravel_set_cmd:
    \int_compare:nNnTF
      \l__unravel_head_cmd_int = { \__unravel_tex_use:n { toks_register } }
      {
        \__unravel_prev_input:V \l__unravel_head_tl
        \int_compare:nNnT \l__unravel_head_char_int = 0
          { \__unravel_scan_int: }
      }
      {
        \int_compare:nNnTF
          \l__unravel_head_cmd_int = { \__unravel_tex_use:n { assign_toks } }
          { \__unravel_prev_input:V \l__unravel_head_tl }
          {
            \__unravel_back_input:
            \__unravel_scan_toks:NN \c_false_bool \c_false_bool
          }
      }
    \__unravel_assign_register:
  }
\__unravel_prefixed_new:nn { assign_int }                          % 73
  { \__unravel_assign_value:nn { } { \__unravel_scan_int: } }
\__unravel_prefixed_new:nn { assign_dimen }                        % 74
  { \__unravel_assign_value:nn { } { \__unravel_scan_normal_dimen: } }
\__unravel_prefixed_new:nn { assign_glue }                         % 75
  { \__unravel_assign_value:nn { } { \__unravel_scan_normal_glue: } }
\__unravel_prefixed_new:nn { assign_mu_glue }                      % 76
  { \__unravel_assign_value:nn { } { \__unravel_scan_mu_glue: } }
\__unravel_prefixed_new:nn { assign_font_dimen }                   % 77
  {
    \__unravel_assign_value:nn
      { \__unravel_scan_int: \__unravel_scan_font_ident: }
      { \__unravel_scan_normal_dimen: }
  }
\__unravel_prefixed_new:nn { assign_font_int }                     % 78
  {
    \__unravel_assign_value:nn
      { \__unravel_scan_font_int: } { \__unravel_scan_int: }
  }
\__unravel_prefixed_new:nn { set_aux }                             % 79
  { % prevdepth = 1, spacefactor = 102
    \int_compare:nNnTF \l__unravel_head_char_int = 1
      { \__unravel_assign_value:nn { } { \__unravel_scan_normal_dimen: } }
      { \__unravel_assign_value:nn { } { \__unravel_scan_int: } }
  }
\__unravel_prefixed_new:nn { set_prev_graf }                       % 80
  { \__unravel_assign_value:nn { } { \__unravel_scan_int: } }
\__unravel_prefixed_new:nn { set_page_dimen }                      % 81
  { \__unravel_assign_value:nn { } { \__unravel_scan_normal_dimen: } }
\__unravel_prefixed_new:nn { set_page_int }                        % 82
  { \__unravel_assign_value:nn { } { \__unravel_scan_int: } }
\__unravel_prefixed_new:nn { set_box_dimen }                       % 83
  {
    \__unravel_assign_value:nn
      { \__unravel_scan_int: } { \__unravel_scan_normal_dimen: }
  }
\__unravel_prefixed_new:nn { set_shape }                           % 84
  {
    \__unravel_assign_value:nn { \__unravel_scan_int: }
      {
        \prg_replicate:nn
          {
            \tl_if_head_eq_meaning:VNT
              \l__unravel_defined_tl \tex_parshape:D { 2 * }
            \tl_tail:N \l__unravel_defined_tl
          }
          { \__unravel_scan_int: }
      }
  }
\__unravel_prefixed_new:nn { def_code }                            % 85
  {
    \__unravel_assign_value:nn
      { \__unravel_scan_int: } { \__unravel_scan_int: }
  }
\__unravel_prefixed_new:nn { def_family }                          % 86
  {
    \__unravel_assign_value:nn
      { \__unravel_scan_int: } { \__unravel_scan_font_ident: }
  }
\__unravel_prefixed_new:nn { set_font }                            % 87
  {
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \tl_put_left:NV \l__unravel_head_tl \l__unravel_tmpa_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \gtl_gput_right:NV \g__unravel_output_gtl \l__unravel_head_tl
    \__unravel_print_action:
  }
\__unravel_prefixed_new:nn { def_font }                            % 88
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_set_action_text:x { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_scan_r_token:
    \__unravel_print_action:x
      { \g__unravel_action_text_str \tl_to_str:N \l__unravel_defined_tl }
    \__unravel_scan_optional_equals:
    \__unravel_scan_file_name:
    \bool_gset_true:N \g__unravel_name_in_progress_bool
    \__unravel_scan_keyword:nTF { aAtT }
      { \__unravel_scan_normal_dimen: }
      {
        \__unravel_scan_keyword:nT { sScCaAlLeEdD }
          { \__unravel_scan_int: }
      }
    \bool_gset_false:N \g__unravel_name_in_progress_bool
    \__unravel_assign_token:n { }
  }
\__unravel_prefixed_new:nn { let }                                 % 94
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_let:D
      { % |let|
        \__unravel_scan_r_token:
        \__unravel_prev_input_get:N \l__unravel_tmpa_tl
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_tmpa_tl }
        \__unravel_get_next:
        \bool_while_do:nn
          { \token_if_eq_catcode_p:NN \l__unravel_head_token \c_space_token }
          { \__unravel_get_next: }
        \tl_if_eq:NNT \l__unravel_head_tl \c__unravel_eq_tl
          { \__unravel_get_next: }
        \token_if_eq_catcode:NNT \l__unravel_head_token \c_space_token
          { \__unravel_get_next: }
      }
      { % |futurelet|
        \__unravel_scan_r_token:
        \__unravel_prev_input_get:N \l__unravel_tmpa_tl
        \__unravel_print_action:x { \tl_to_str:N \l__unravel_tmpa_tl }
        \__unravel_get_next:
        \gtl_set_eq:NN \l__unravel_tmpb_gtl \l__unravel_head_gtl
        \__unravel_get_next:
        \__unravel_back_input:
        \gtl_set_eq:NN \l__unravel_head_gtl \l__unravel_tmpb_gtl
        \__unravel_back_input:
      }
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \tl_put_right:Nn \l__unravel_tmpa_tl { = ~ \l__unravel_head_token }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_exp_args:Nx \use:n
      {
        \exp_not:V \l__unravel_head_tl
        \tex_let:D \tl_tail:N \l__unravel_tmpa_tl
      }
    \__unravel_print_assigned_token:
  }
\__unravel_prefixed_new:nn { shorthand_def }                       % 95
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \tl_set:Nx \l__unravel_prev_action_tl
      { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_scan_r_token:
    \__unravel_print_action:x
      { \l__unravel_prev_action_tl \tl_to_str:N \l__unravel_defined_tl }
    \exp_after:wN \cs_set_eq:NN \l__unravel_defined_tl \scan_stop:
    \__unravel_scan_optional_equals:
    \__unravel_scan_int:
    \__unravel_assign_token:n { }
  }
\__unravel_prefixed_new:nn { read_to_cs }                          % 96
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_print_action:x { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_scan_int:
    \__unravel_scan_to:
    \__unravel_scan_r_token:
    \__unravel_prev_input_get:N \l__unravel_tmpa_tl
    \__unravel_read_to_cs_safe:fTF
      { \__unravel_tl_first_int:N \l__unravel_tmpa_tl }
      { \__unravel_assign_token:n { } }
      {
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_tex_fatal_error:nV { cannot-read } \l__unravel_head_tl
      }
  }
\prg_new_conditional:Npnn \__unravel_read_to_cs_safe:n #1 { TF }
  {
    \int_compare:nNnTF { \tex_interactionmode:D } > { 1 }
      { \prg_return_true: }
      {
        \int_compare:nNnTF {#1} < { 0 }
          { \prg_return_false: }
          {
            \int_compare:nNnTF {#1} > { 15 }
              { \prg_return_false: }
              {
                \tex_ifeof:D #1 \exp_stop_f:
                  \prg_return_false:
                \else:
                  \prg_return_true:
                \fi:
              }
          }
      }
  }
\cs_generate_variant:Nn \__unravel_read_to_cs_safe:nTF { f }
\__unravel_prefixed_new:nn { def }                                 % 97
  {
    \__unravel_prev_input_get:N \l__unravel_tmpa_tl
    \tl_set:NV \l__unravel_defining_tl \l__unravel_tmpa_tl
    \tl_put_right:NV \l__unravel_defining_tl \l__unravel_head_tl
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \int_compare:nNnTF \l__unravel_head_char_int < 2
      { % def/gdef
        \__unravel_scan_r_token:
        \tl_put_right:NV \l__unravel_defining_tl \l__unravel_defined_tl
        \__unravel_scan_toks:NN \c_true_bool \c_false_bool
      }
      { % edef/xdef
        \__unravel_scan_r_token:
        \tl_put_right:NV \l__unravel_defining_tl \l__unravel_defined_tl
        \__unravel_scan_toks:NN \c_true_bool \c_true_bool
      }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_assign_token:n
      { \tl_set_eq:NN \l__unravel_head_tl \l__unravel_defining_tl }
  }
\__unravel_prefixed_new:nn { set_box }                             % 98
  {
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_scan_int:
    \__unravel_scan_optional_equals:
    \bool_if:NTF \g__unravel_set_box_allowed_bool
      { \__unravel_do_box:N \c_false_bool }
      {
        \__unravel_error:nnnnn { improper-setbox } { } { } { } { }
        \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
        \__unravel_omit_after_assignment:w
      }
  }
\__unravel_prefixed_new:nn { hyph_data }                           % 99
  {
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_scan_toks:NN \c_false_bool \c_false_bool
    \__unravel_assign_token:n { }
  }
\__unravel_prefixed_new:nn { set_interaction }                     % 100
  {
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \tl_put_left:NV \l__unravel_head_tl \l__unravel_tmpa_tl
    \tl_use:N \l__unravel_head_tl \scan_stop:
    \__unravel_print_assignment:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_prefixed_new:nn { letterspace_font }                    % 101
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_set_action_text:x { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_scan_r_token:
    \__unravel_print_action:x
      { \g__unravel_action_text_str \tl_to_str:N \l__unravel_defined_tl }
    \exp_after:wN \cs_set_eq:NN \l__unravel_defined_tl \__unravel_nullfont:
    \__unravel_scan_optional_equals:
    \__unravel_scan_font_ident:
    \__unravel_scan_int:
    \__unravel_assign_token:n { }
  }
\__unravel_prefixed_new:nn { pdf_copy_font }                       % 102
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_set_action_text:x { \tl_to_str:N \l__unravel_head_tl }
    \__unravel_scan_r_token:
    \__unravel_print_action:x
      { \g__unravel_action_text_str \tl_to_str:N \l__unravel_defined_tl }
    \exp_after:wN \cs_set_eq:NN \l__unravel_defined_tl \__unravel_nullfont:
    \__unravel_scan_optional_equals:
    \__unravel_scan_font_ident:
    \__unravel_assign_token:n { }
  }
\__unravel_prefixed_new:nn { register }                            % 89
  { \__unravel_do_register:N 0 }
\__unravel_prefixed_new:nn { advance }                             % 90
  { \__unravel_do_operation:N 1 }
\__unravel_prefixed_new:nn { multiply }                            % 91
  { \__unravel_do_operation:N 2 }
\__unravel_prefixed_new:nn { divide }                              % 92
  { \__unravel_do_operation:N 3 }
\cs_new_protected:Npn \__unravel_do_operation:N #1
  {
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_print_action:
    \__unravel_get_x_next:
    \__unravel_set_cmd:
    \int_compare:nNnTF
      \l__unravel_head_cmd_int > { \__unravel_tex_use:n { assign_mu_glue } }
      {
        \int_compare:nNnTF
          \l__unravel_head_cmd_int = { \__unravel_tex_use:n { register } }
          { \__unravel_do_register:N #1 }
          { \__unravel_do_operation_fail:w }
      }
      {
        \int_compare:nNnTF
          \l__unravel_head_cmd_int < { \__unravel_tex_use:n { assign_int } }
          { \__unravel_do_operation_fail:w }
          {
            \__unravel_prev_input:V \l__unravel_head_tl
            \exp_args:NNf \__unravel_do_register_set:Nn #1
              {
                \int_eval:n
                  {
                    \l__unravel_head_cmd_int
                    - \__unravel_tex_use:n { assign_toks }
                  }
              }
          }
      }
  }
\cs_new_protected:Npn \__unravel_do_operation_fail:w
  {
    \__unravel_error:nnnnn { after-advance } { } { } { } { }
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \__unravel_omit_after_assignment:w
  }
\cs_new_protected:Npn \__unravel_do_register:N #1
  {
    \exp_args:NNV \__unravel_do_register_aux:Nn #1
      \l__unravel_head_char_int
  }
\cs_new_protected:Npn \__unravel_do_register_aux:Nn #1#2
  {
    \int_compare:nNnTF { \tl_tail:n {#2} } = 0
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_assignment:
        \__unravel_scan_int:
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_prev_input_silent:V \l__unravel_head_tl
      }
      {
        \__unravel_prev_input_silent:V \l__unravel_head_tl
        \__unravel_print_assignment:
      }
    \tl_set_eq:NN \l__unravel_defined_tl \l__unravel_head_tl
    \exp_args:NNf \__unravel_do_register_set:Nn #1
      { \int_eval:n { #2 / 1 000 000 } }
  }
\cs_new_protected:Npn \__unravel_do_register_set:Nn #1#2
  {
    \int_compare:nNnTF {#1} = 0
      { % truly register command
        \__unravel_scan_optional_equals:
      }
      { % \advance, \multiply, \divide
        \__unravel_scan_keyword:nF { bByY }
          { \__unravel_prev_input_silent:n { by } }
      }
    \int_compare:nNnTF {#1} < 2
      {
        \int_case:nnF {#2}
          {
            { 1 } { \__unravel_scan_int:          } % count
            { 2 } { \__unravel_scan_normal_dimen: } % dim
            { 3 } { \__unravel_scan_normal_glue:  } % glue
            { 4 } { \__unravel_scan_mu_glue:      } % muglue
          }
          { \__unravel_error:nxxxx { internal } { do-reg=#2 } { } { } { } }
      }
      { \__unravel_scan_int: }
    \__unravel_assign_register:
  }
\cs_new_protected:Npn \__unravel_do_assignments:
  {
    \__unravel_get_x_non_relax:
    \__unravel_set_cmd:
    \int_compare:nNnT
      \l__unravel_head_cmd_int
      > { \__unravel_tex_use:n { max_non_prefixed_command } }
      {
        \bool_gset_false:N \g__unravel_set_box_allowed_bool
        \__unravel_prev_input_gpush:
        \__unravel_prefixed_command:
        \bool_gset_true:N \g__unravel_set_box_allowed_bool
        \__unravel_do_assignments:
      }
  }
\__unravel_new_tex_expandable:nn { undefined_cs }                  % 103
  { \tl_use:N \l__unravel_head_tl \__unravel_print_expansion: }
\__unravel_new_tex_expandable:nn { expand_after }                  % 104
  {
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_expandafter:D
      { \__unravel_expandafter: } { \__unravel_unless: }
  }
\cs_new_protected:Npn \__unravel_expandafter:
  {
    \gtl_set_eq:NN \l__unravel_tmpb_gtl \l__unravel_head_gtl
    \__unravel_get_next:
    \gtl_concat:NNN \l__unravel_head_gtl
      \l__unravel_tmpb_gtl \l__unravel_head_gtl
    \__unravel_prev_input_gpush_gtl:N \l__unravel_head_gtl
    \__unravel_print_expansion:x { \gtl_to_str:N \l__unravel_head_gtl }
    \__unravel_get_next:
    \__unravel_token_if_expandable:NTF \l__unravel_head_token
      { \__unravel_expand_do:N \prg_do_nothing: }
      { \__unravel_back_input: }
    \__unravel_prev_input_gpop:N \l__unravel_head_gtl
    \__unravel_set_action_text:x
      { back_input: ~ \gtl_to_str:N \l__unravel_head_gtl }
    \gtl_pop_left:N \l__unravel_head_gtl
    \__unravel_back_input:
    \__unravel_print_expansion:
  }
\cs_new_protected:Npn \__unravel_unless:
  {
    \__unravel_get_token:
    \int_compare:nNnTF
      \l__unravel_head_cmd_int = { \__unravel_tex_use:n { if_test } }
      {
        \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_ifcase:D
          { \__unravel_unless_bad: }
          {
            \tl_put_left:Nn \l__unravel_head_tl { \reverse_if:N }
            % \int_add:Nn \l__unravel_head_char_int { 32 }
            \__unravel_expand_nonmacro:
          }
      }
      { \__unravel_unless_bad: }
  }
\cs_new_protected:Npn \__unravel_unless_bad:
  {
    \__unravel_error:nnnnn { bad-unless } { } { } { } { }
    \__unravel_back_input:
  }
\__unravel_new_tex_expandable:nn { no_expand }                     % 105
  {
    \token_if_eq_meaning:NNTF \l__unravel_head_token \tex_noexpand:D
      { \__unravel_noexpand:N }
      { \__unravel_pdfprimitive: }
  }
\cs_new_protected:Npn \__unravel_noexpand:N #1
  {
    \__unravel_get_token:
    \cs_if_eq:NNTF #1 \prg_do_nothing:
      {
        \tl_if_empty:NTF \l__unravel_head_tl
          { \__unravel_back_input: }
          {
            \exp_after:wN \__unravel_token_if_definable:NTF \l__unravel_head_tl
              { \__unravel_noexpand_after: }
              { \__unravel_back_input: }
          }
      }
      {
        \__unravel_back_input:
        \__unravel_get_next:
        \__unravel_token_if_expandable:NT \l__unravel_head_token
          { \cs_set_eq:NN \l__unravel_head_token \__unravel_special_relax: }
      }
  }
\cs_new_protected:Npn \__unravel_noexpand_after:
  {
    \group_begin:
      \__unravel_set_escapechar:n { 92 }
      \exp_args:NNc
    \group_end:
    \__unravel_noexpand_after:N
      { notexpanded: \exp_after:wN \token_to_str:N \l__unravel_head_tl }
  }
\cs_new_protected:Npn \__unravel_noexpand_after:N #1
  {
    \cs_gset_eq:NN #1 \__unravel_special_relax:
    \__unravel_back_input:n {#1}
  }
\cs_new_protected:Npn \__unravel_pdfprimitive:
  { \__unravel_not_implemented:n { pdfprimitive } }
\__unravel_new_tex_expandable:nn { input }                       % 106
  {
    \int_case:nnF \l__unravel_head_char_int
      {
        { 1 } { \__unravel_endinput: } % \endinput
        { 2 } { \__unravel_scantokens: } % \scantokens
      }
      { % 0=\input
        \bool_if:NTF \g__unravel_name_in_progress_bool
          { \__unravel_insert_relax: } { \__unravel_input: }
      }
  }
\cs_new_protected:Npn \__unravel_endinput:
  {
    \group_begin:
      \msg_warning:nn { unravel } { endinput-ignored }
    \group_end:
    \__unravel_print_expansion:
  }
\cs_new_protected:Npn \__unravel_scantokens:
  {
    \__unravel_prev_input_gpush:
    \__unravel_scan_toks:NN \c_false_bool \c_false_bool
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \tl_set_rescan:Nno \l__unravel_head_tl { } \l__unravel_tmpa_tl
    \__unravel_back_input:V \l__unravel_head_tl
    \__unravel_print_expansion:x { \tl_to_str:N \l__unravel_tmpa_tl }
  }
\cs_new_protected:Npn \__unravel_input:
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_scan_file_name:
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \tl_set:Nx \l__unravel_tmpa_tl { \tl_tail:N \l__unravel_head_tl }
    \__unravel_file_get:nN \l__unravel_tmpa_tl \l__unravel_tmpa_tl
    \__unravel_back_input:V \l__unravel_tmpa_tl
    \__unravel_print_expansion:x { \tl_to_str:N \l__unravel_head_tl }
  }
\__unravel_new_tex_expandable:nn { cs_name }                       % 109
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_expansion:
    \__unravel_csname_loop:
    \__unravel_prev_input_silent:V \l__unravel_head_tl
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_back_input_tl_o:
  }
\cs_new_protected:Npn \__unravel_csname_loop:
  {
    \__unravel_get_x_next:
    \__unravel_gtl_if_head_is_definable:NTF \l__unravel_head_gtl
      {
        \cs_if_eq:NNF \l__unravel_head_token \tex_endcsname:D
          {
            \__unravel_back_input:
            \__unravel_tex_error:nV { missing-endcsname } \l__unravel_head_tl
            \tl_set:Nn \l__unravel_head_tl { \tex_endcsname:D }
          }
      }
      {
        \__unravel_prev_input_silent:x
          { \__unravel_token_to_char:N \l__unravel_head_token }
        \__unravel_csname_loop:
      }
  }
\__unravel_new_tex_expandable:nn { convert }                       % 110
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_expansion:
    \int_case:nn \l__unravel_head_char_int
      {
        0      \__unravel_scan_int:
        1      \__unravel_scan_int:
        2      \__unravel_convert_string:
        3      \__unravel_convert_meaning:
        4      \__unravel_scan_font_ident:
        8      \__unravel_scan_font_ident:
        9      \__unravel_scan_font_ident:
        { 10 } \__unravel_scan_font_ident:
        { 11 } \__unravel_scan_int:
        { 12 } \__unravel_scan_int:
        { 13 } \__unravel_scan_pdf_ext_toks:
        { 14 } \__unravel_scan_pdf_ext_toks:
        { 15 } \__unravel_scan_int:
        { 16 } \__unravel_scan_int:
        { 17 } \__unravel_scan_pdfstrcmp:
        { 18 } \__unravel_scan_pdfcolorstackinit:
        { 19 } \__unravel_scan_pdf_ext_toks:
        { 20 } \__unravel_scan_pdf_ext_toks:
        { 22 } \__unravel_scan_pdf_ext_toks:
        { 23 } \__unravel_scan_pdf_ext_toks:
        { 24 }
          {
            \__unravel_scan_keyword:n { fFiIlLeE }
            \__unravel_scan_pdf_ext_toks:
          }
        { 25 } \__unravel_scan_pdffiledump:
        { 26 } \__unravel_scan_pdfmatch:
        { 27 } \__unravel_scan_int:
        { 28 } \__unravel_scan_int:
        { 30 } \__unravel_scan_int:
        { 31 } \__unravel_scan_pdfximagebbox:
        { 33 } \__unravel_scan_directlua:
        { 34 } \__unravel_scan_pdf_ext_toks:
        { 35 } \__unravel_scan_pdf_ext_toks:
        { 40 }
          {
            \__unravel_scan_int:
            \__unravel_prev_input_silent:n { ~ }
            \__unravel_scan_int:
          }
      }
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_back_input_tl_o:
  }
\cs_new_protected:Npn \__unravel_convert_string:
  {
    \__unravel_get_next:
    \tl_if_empty:NTF \l__unravel_head_tl
      { \__unravel_prev_input:x { \gtl_to_str:N \l__unravel_head_gtl } }
      { \__unravel_prev_input:V \l__unravel_head_tl }
  }
\cs_new_protected:Npn \__unravel_convert_meaning:
  {
    \__unravel_get_next:
    \tl_if_empty:NTF \l__unravel_head_tl
      { \__unravel_prev_input:n { \l__unravel_head_token } }
      { \__unravel_prev_input:V \l__unravel_head_tl }
  }
\cs_new_protected:Npn \__unravel_scan_pdfstrcmp:
  {
    \__unravel_scan_toks_to_str:
    \__unravel_scan_toks_to_str:
  }
\cs_new_protected:Npn \__unravel_scan_pdfximagebbox:
  { \__unravel_scan_int: \__unravel_scan_int: }
\cs_new_protected:Npn \__unravel_scan_pdfcolorstackinit:
  {
    \__unravel_scan_keyword:nTF { pPaAgGeE }
      { \bool_set_true:N \l__unravel_tmpa_bool }
      { \bool_set_false:N \l__unravel_tmpb_bool }
    \__unravel_scan_keyword:nF { dDiIrReEcCtT }
      { \__unravel_scan_keyword:n { pPaAgGeE } }
    \__unravel_scan_toks_to_str:
  }
\cs_new_protected:Npn \__unravel_scan_pdffiledump:
  {
    \__unravel_scan_keyword:nT { oOfFfFsSeEtT } \__unravel_scan_int:
    \__unravel_scan_keyword:nT { lLeEnNgGtThH } \__unravel_scan_int:
    \__unravel_scan_pdf_ext_toks:
  }
\cs_new_protected:Npn \__unravel_scan_pdfmatch:
  {
    \__unravel_scan_keyword:n { iIcCaAsSeE }
    \__unravel_scan_keyword:nT { sSuUbBcCoOuUnNtT }
      { \__unravel_scan_int: }
    \__unravel_scan_pdf_ext_toks:
    \__unravel_scan_pdf_ext_toks:
  }
\sys_if_engine_luatex:T
  {
    \cs_new_protected:Npn \__unravel_scan_directlua:
      {
        \__unravel_get_x_non_relax:
        \token_if_eq_catcode:NNTF \l__unravel_head_token \c_group_begin_token
          { \__unravel_back_input: }
          {
            \__unravel_scan_int:
            \__unravel_get_x_non_relax:
          }
        \__unravel_scan_pdf_ext_toks:
     }
  }
\__unravel_new_tex_expandable:nn { the }                           % 111
  { \__unravel_get_the:N }
\cs_new_protected:Npn \__unravel_get_the:N #1
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_expansion:
    \int_if_odd:nTF \l__unravel_head_char_int
      { % \unexpanded, \detokenize
        \__unravel_scan_toks:NN \c_false_bool \c_false_bool
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_set_action_text:x { \tl_to_str:N \l__unravel_head_tl }
      }
      { % \the
        \__unravel_get_x_next:
        \__unravel_scan_something_internal:n { 5 }
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_set_action_text:x
          {
            \tl_head:N \l__unravel_head_tl
            => \tl_tail:N \l__unravel_head_tl
          }
        \tl_set:Nx \l__unravel_head_tl
          { \exp_not:N \exp_not:n { \tl_tail:N \l__unravel_head_tl } }
      }
    \cs_if_eq:NNTF #1 \__unravel_get_token_xdef:
      {
        \tl_put_right:NV \l__unravel_defining_tl \l__unravel_head_tl
        \__unravel_prev_input:V \l__unravel_head_tl
      }
      {
        \cs_if_eq:NNTF #1 \__unravel_get_token_x:
          {
            \__unravel_exp_args:NNx \gtl_set:Nn \l__unravel_tmpb_gtl { \l__unravel_head_tl }
            \__unravel_prev_input_gtl:N \l__unravel_tmpb_gtl
          }
          {
            \tl_set:Nx \l__unravel_tmpa_tl { \exp_args:NV \exp_not:o \l__unravel_head_tl }
            \__unravel_back_input:V \l__unravel_tmpa_tl
          }
        \__unravel_print_expansion:
      }
    #1
  }
\__unravel_new_tex_expandable:nn { top_bot_mark }                  % 112
  { \__unravel_back_input_tl_o: }
\__unravel_new_tex_expandable:nn { end_template }                  % 117
  {
    \__unravel_not_implemented:n { end-template } { } { } { }
    \__unravel_back_input_tl_o:
  }
\cs_new_protected:Npn \__unravel_pass_text:
  {
    \__unravel_input_if_empty:TF
      { \__unravel_pass_text_empty: }
      {
        \__unravel_input_get:N \l__unravel_tmpb_gtl
        \if_true:
          \if_case:w \gtl_head_do:NN \l__unravel_tmpb_gtl \c_one_int
            \exp_after:wN \__unravel_pass_text_done:w
          \fi:
          \__unravel_input_gpop:N \l__unravel_tmpb_gtl
          \exp_after:wN \__unravel_pass_text:
        \else:
          \use:c { fi: }
          \int_set:Nn \l__unravel_if_nesting_int { 1 }
          \__unravel_input_gpop:N \l__unravel_tmpb_gtl
          \exp_after:wN \__unravel_pass_text_nested:
        \fi:
      }
  }
\cs_new_protected:Npn \__unravel_pass_text_done:w
  {
    \__unravel_get_next:
    \token_if_eq_meaning:NNT \l__unravel_head_token \fi: { \if_true: }
    \else:
  }
\cs_new_protected:Npn \__unravel_pass_text_nested:
  {
    \__unravel_input_if_empty:TF
      { \__unravel_pass_text_empty: }
      {
        \__unravel_input_get:N \l__unravel_tmpb_gtl
        \if_true:
          \if_true:
            \gtl_head_do:NN \l__unravel_tmpb_gtl \else:
            \int_decr:N \l__unravel_if_nesting_int
            \use_none:nnnnn
          \fi:
          \use_none:nnn
        \fi:
        \int_incr:N \l__unravel_if_nesting_int
        \fi:
        \__unravel_input_gpop:N \l__unravel_unused_gtl
        \int_compare:nNnTF \l__unravel_if_nesting_int = 0
          { \__unravel_pass_text: }
          { \__unravel_pass_text_nested: }
      }
  }
\cs_new_protected:Npn \__unravel_pass_text_empty:
  {
    \__unravel_error:nnnnn { runaway-if } { } { } { } { }
    \__unravel_exit:w
  }
\cs_new_protected:Npn \__unravel_cond_push:
  {
    \tl_gput_left:Nx \g__unravel_if_limit_tl
      { { \int_use:N \g__unravel_if_limit_int } }
    \int_gincr:N \g__unravel_if_depth_int
    \int_gzero:N \g__unravel_if_limit_int
  }
\cs_new_protected:Npn \__unravel_cond_pop:
  {
    \int_gset:Nn \g__unravel_if_limit_int
      { \tl_head:N \g__unravel_if_limit_tl }
    \tl_gset:Nx \g__unravel_if_limit_tl
      { \tl_tail:N \g__unravel_if_limit_tl }
    \int_gdecr:N \g__unravel_if_depth_int
  }
\cs_new_protected:Npn \__unravel_change_if_limit:nn #1#2
  {
    \int_compare:nNnTF {#2} = \g__unravel_if_depth_int
      { \int_gset:Nn \g__unravel_if_limit_int {#1} }
      {
        \tl_clear:N \l__unravel_tmpa_tl
        \prg_replicate:nn { \g__unravel_if_depth_int - #2 - 1 }
          {
            \tl_put_right:Nx \l__unravel_tmpa_tl
              { { \tl_head:N \g__unravel_if_limit_tl } }
            \tl_gset:Nx \g__unravel_if_limit_tl
              { \tl_tail:N \g__unravel_if_limit_tl }
          }
        \tl_gset:Nx \g__unravel_if_limit_tl
          { \l__unravel_tmpa_tl {#1} \tl_tail:N \g__unravel_if_limit_tl }
      }
  }
\__unravel_new_tex_expandable:nn { if_test }                       % 107
  {
    \__unravel_cond_push:
    \exp_args:NV \__unravel_cond_aux:n \g__unravel_if_depth_int
  }
\cs_new_protected:Npn \__unravel_cond_aux:n #1
  {
    \int_case:nnF \l__unravel_head_char_int
      {
        { 12 } { \__unravel_test_ifx:n {#1} }
        { 16 } { \__unravel_test_case:n {#1} }
        { 21 } { \__unravel_test_pdfprimitive:n {#1} } % ^^A todo and \unless
      }
      {
        \__unravel_prev_input_gpush:N \l__unravel_head_tl
        \__unravel_print_expansion:
        \int_case:nn \l__unravel_head_char_int
          {
            {  0 } { \__unravel_test_two_chars: } % if
            {  1 } { \__unravel_test_two_chars: } % ifcat
            {  2 } % ifnum
              { \__unravel_test_two_vals:N \__unravel_scan_int: }
            {  3 } % ifdim
              { \__unravel_test_two_vals:N \__unravel_scan_normal_dimen: }
            {  4 } { \__unravel_scan_int: } % ifodd
            % {  5 } { } % ifvmode
            % {  6 } { } % ifhmode
            % {  7 } { } % ifmmode
            % {  8 } { } % ifinner
            {  9 } { \__unravel_scan_int: } % ifvoid
            { 10 } { \__unravel_scan_int: } % ifhbox
            { 11 } { \__unravel_scan_int: } % ifvbox
            { 13 } { \__unravel_scan_int: } % ifeof
            % { 14 } { } % iftrue
            % { 15 } { } % iffalse
            { 17 } { \__unravel_test_ifdefined: } % ifdefined
            { 18 } { \__unravel_test_ifcsname: } % ifcsname
            { 19 } % iffontchar
              { \__unravel_scan_font_ident: \__unravel_scan_int: }
            % { 20 } { } % ifincsname % ^^A todo: something?
            { 22 } % ifpdfabsnum
              { \__unravel_test_two_vals:N \__unravel_scan_int: }
            { 23 } % ifpdfabsdim
              { \__unravel_test_two_vals:N \__unravel_scan_normal_dimen: }
          }
        \__unravel_prev_input_gpop:N \l__unravel_head_tl
        \__unravel_set_action_text:x { \tl_to_str:N \l__unravel_head_tl }
        \l__unravel_head_tl \scan_stop:
          \exp_after:wN \__unravel_cond_true:n
        \else:
          \exp_after:wN \__unravel_cond_false:n
        \fi:
        {#1}
      }
  }
\cs_new_protected:Npn \__unravel_cond_true:n #1
  {
    \__unravel_change_if_limit:nn { 3 } {#1} % wait for else/fi
    \__unravel_print_expansion:x { \g__unravel_action_text_str = true }
  }
\cs_new_protected:Npn \__unravel_cond_false:n #1
  {
    \__unravel_cond_false_loop:n {#1}
    \__unravel_cond_false_common:
    \__unravel_print_expansion:x
      {
        \g__unravel_action_text_str = false ~
        => ~ skipped ~ to ~ \iow_char:N\\fi
      }
  }
\cs_new_protected:Npn \__unravel_cond_false_loop:n #1
  {
    \__unravel_pass_text:
    \int_compare:nNnTF \g__unravel_if_depth_int = {#1}
      {
        \token_if_eq_meaning:NNT \l__unravel_head_token \or:
          {
            \__unravel_error:nnnnn { extra-or } { } { } { } { }
            \__unravel_cond_false_loop:n {#1}
          }
      }
      {
        \token_if_eq_meaning:NNT \l__unravel_head_token \fi:
          { \__unravel_cond_pop: }
        \__unravel_cond_false_loop:n {#1}
      }
  }
\cs_new_protected:Npn \__unravel_cond_false_common:
  {
    \token_if_eq_meaning:NNTF \l__unravel_head_token \fi:
      { \__unravel_cond_pop: }
      { \int_gset:Nn \g__unravel_if_limit_int { 2 } } % wait for fi
  }
\cs_new_protected:Npn \__unravel_test_two_vals:N #1
  {
    #1
    \__unravel_get_x_non_blank:
    \__unravel_tl_if_in:ooTF { < = > } \l__unravel_head_tl { }
      {
        \__unravel_error:nnnnn { missing-equals } { } { } { } { }
        \__unravel_back_input:
        \tl_set:Nn \l__unravel_head_tl { = }
      }
    \__unravel_prev_input:V \l__unravel_head_tl
    #1
  }
\cs_new_protected:Npn \__unravel_test_two_chars:
  {
    \__unravel_test_two_chars_aux:
    \__unravel_prev_input:V \l__unravel_head_tl
    \__unravel_test_two_chars_aux:
    \__unravel_prev_input:V \l__unravel_head_tl
  }
\cs_new_protected:Npn \__unravel_test_two_chars_aux:
  {
    \__unravel_get_x_next:
    \gtl_if_tl:NF \l__unravel_head_gtl
      {
        \tl_set:Nx \l__unravel_head_tl
          {
            \gtl_if_head_is_group_begin:NTF \l__unravel_head_gtl
              { \c_group_begin_token } { \c_group_end_token }
          }
      }
    \tl_put_left:Nn \l__unravel_head_tl { \exp_not:N } % ^^A todo: prettify.
  }
\cs_new_protected:Npn \__unravel_test_ifx:n #1
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_expansion:
    \__unravel_get_next:
    \gtl_set_eq:NN \l__unravel_tmpb_gtl \l__unravel_head_gtl
    \cs_set_eq:NN \l__unravel_tmpb_token \l__unravel_head_token
    \__unravel_get_next:
    \__unravel_prev_input_gpop:N \l__unravel_tmpa_tl
    \__unravel_set_action_text:x
      {
        Compare:~ \tl_to_str:N \l__unravel_tmpa_tl
        \__unravel_test_ifx_str:NN \l__unravel_tmpb_token \l__unravel_tmpb_gtl
        \__unravel_test_ifx_str:NN \l__unravel_head_token \l__unravel_head_gtl
      }
    \__unravel_test_ifx_aux:NNN \l__unravel_tmpb_token \l__unravel_tmpb_gtl
      \__unravel_test_ifx_aux:w
      \exp_after:wN \__unravel_cond_true:n
    \else:
      \exp_after:wN \__unravel_cond_false:n
    \fi:
    {#1}
  }
\cs_new:Npn \__unravel_test_ifx_str:NN #1#2
  {
    \token_if_eq_meaning:NNT #1 \__unravel_special_relax:
      { \iow_char:N \\notexpanded: }
    \gtl_to_str:N #2
  }
\cs_new_protected:Npn \__unravel_test_ifx_aux:NNN #1#2#3
  {
    \token_if_eq_meaning:NNTF #1 \__unravel_special_relax:
      {
        \gtl_head_do:NN #2 \__unravel_token_if_expandable:NTF
          { #3 #1 } { \gtl_head_do:NN #2 #3 }
      }
      { \gtl_head_do:NN #2 #3 }
  }
\cs_new:Npn \__unravel_test_ifx_aux:w
  {
    \__unravel_test_ifx_aux:NNN \l__unravel_head_token \l__unravel_head_gtl
      \l__unravel_tmpa_tl
  }
\cs_new_protected:Npn \__unravel_test_case:n #1
  {
    \__unravel_prev_input_gpush:N \l__unravel_head_tl
    \__unravel_print_expansion:
    \bool_if:NT \g__unravel_internal_debug_bool { \iow_term:n { {\ifcase level~#1} } }
    \__unravel_scan_int:
    \__unravel_prev_input_get:N \l__unravel_head_tl
    \tl_set:Nx \l__unravel_head_tl { \tl_tail:N \l__unravel_head_tl }
    % ^^A does text_case_aux use prev_input_seq?
    \exp_args:No \__unravel_test_case_aux:nn { \l__unravel_head_tl } {#1}
    \__unravel_prev_input_gpop:N \l__unravel_head_tl
    \__unravel_print_expansion:x { \tl_to_str:N \l__unravel_head_tl }
  }
\cs_new_protected:Npn \__unravel_test_case_aux:nn #1#2
  {
    \int_compare:nNnTF {#1} = 0
      { \__unravel_change_if_limit:nn { 4 } {#2} }
      {
        \__unravel_pass_text:
        \int_compare:nNnTF \g__unravel_if_depth_int = {#2}
          {
            \token_if_eq_meaning:NNTF \l__unravel_head_token \or:
              {
                \exp_args:Nf \__unravel_test_case_aux:nn
                  { \int_eval:n { #1 - 1 } } {#2}
              }
              { \__unravel_cond_false_common: }
          }
          {
            \token_if_eq_meaning:NNT \l__unravel_head_token \fi:
              { \__unravel_cond_pop: }
            \__unravel_test_case_aux:nn {#1} {#2}
          }
      }
  }
\cs_new_protected:Npn \__unravel_test_ifdefined:
  {
    \__unravel_input_if_empty:TF
      { \__unravel_pass_text_empty: }
      {
        \__unravel_input_gpop:N \l__unravel_tmpb_gtl
        \__unravel_set_action_text:x
          {
            Conditional:~ \tl_to_str:N \l__unravel_head_tl
            \gtl_to_str:N \l__unravel_tmpb_gtl
          }
        \__unravel_prev_input:x
          {
            \gtl_if_tl:NTF \l__unravel_tmpb_gtl
              { \gtl_head:N \l__unravel_tmpb_gtl }
              { \gtl_to_str:N \l__unravel_tmpb_gtl }
          }
      }
  }
\cs_new_protected:Npn \__unravel_test_ifcsname:
  {
    \__unravel_csname_loop:
    \__unravel_prev_input:V \l__unravel_head_tl
  }
\__unravel_new_tex_expandable:nn { fi_or_else }                    % 108
  {
    \int_compare:nNnTF \l__unravel_head_char_int > \g__unravel_if_limit_int
      {
        \int_compare:nNnTF \g__unravel_if_limit_int = 0
          {
            \int_compare:nNnTF \g__unravel_if_depth_int = 0
              { \__unravel_error:nnnnn { extra-fi-or-else } { } { } { } { } }
              { \__unravel_insert_relax: }
          }
          { \__unravel_error:nnnnn { extra-fi-or-else } { } { } { } { } }
      }
      {
        \__unravel_set_action_text:
        \int_compare:nNnF \l__unravel_head_char_int = 2
          {
            \__unravel_fi_or_else_loop:
            \__unravel_set_action_text:x
              {
                \g__unravel_action_text_str \c_space_tl
                => ~ skipped ~ to ~ \tl_to_str:N \l__unravel_head_tl
              }
          }
        % ^^A todo: in the terminal output the token itself is missing.
        \__unravel_print_expansion:
        \__unravel_cond_pop:
      }
  }
\cs_new_protected:Npn \__unravel_fi_or_else_loop:
  {
    \int_compare:nNnF \l__unravel_head_char_int = 2
      {
        \__unravel_pass_text:
        \__unravel_set_cmd:
        \__unravel_fi_or_else_loop:
      }
  }
\tl_new:N \l__unravel_print_tl
\sys_if_engine_luatex:TF
  {
    \cs_new_protected:Npx \__unravel_print_normalize_null:
      {
        \tl_replace_all:Nnn \exp_not:N \l__unravel_print_tl
          { \char_generate:nn { 0 } { 12 } }
          { \tl_to_str:n { ^ ^ @ } }
      }
  }
  { \cs_new_protected:Npn \__unravel_print_normalize_null: { } }
\cs_new_protected:Npn \__unravel_print:n #1
  {
    \tl_set:Nn \l__unravel_print_tl {#1}
    \__unravel_print_normalize_null:
    \__unravel_exp_args:Nx \iow_term:n { \l__unravel_print_tl }
  }
\cs_new_protected:Npn \__unravel_print:x
  { \__unravel_exp_args:Nx \__unravel_print:n }
\cs_new_protected:Npn \__unravel_log:n #1
  {
    \tl_set:Nn \l__unravel_print_tl {#1}
    \__unravel_print_normalize_null:
    \__unravel_exp_args:Nx \iow_log:n { \l__unravel_print_tl }
  }
\cs_new_protected:Npn \__unravel_print_message:nn #1 #2
  {
    \int_compare:nNnF \g__unravel_online_int < 0
      {
        \int_compare:nNnTF \g__unravel_online_int = 0
          { \iow_wrap:nnnN { #1 #2 } { #1 } { } \__unravel_log:n }
          { \iow_wrap:nnnN { #1 #2 } { #1 } { } \__unravel_print:n }
      }
  }
\cs_new_protected:Npn \__unravel_set_action_text:x #1
  {
    \group_begin:
      \__unravel_set_escapechar:n { 92 }
      \str_gset:Nx \g__unravel_action_text_str {#1}
    \group_end:
  }
\cs_new_protected:Npn \__unravel_set_action_text:
  {
    \__unravel_set_action_text:x
      {
        \tl_to_str:N \l__unravel_head_tl
        \tl_if_single_token:VT \l__unravel_head_tl
          { = ~ \token_to_meaning:N \l__unravel_head_token }
      }
  }
\cs_new_protected:Npn \__unravel_print_state:
  {
    \group_begin:
      \__unravel_set_escapechar:n { 92 }
      \tl_use:N \g__unravel_before_print_state_tl
      \int_compare:nNnT \g__unravel_online_int > 0
        {
          \__unravel_print_state_output:
          \__unravel_print_state_prev:
          \__unravel_print_state_input:
        }
    \group_end:
  }
\cs_new_protected:Npn \__unravel_print_state_output:
  {
    \__unravel_exp_args:Nx \__unravel_print_state_output:n
      { \gtl_to_str:N \g__unravel_output_gtl }
  }
\cs_new_protected:Npn \__unravel_print_state_output:n #1
  {
    \tl_if_empty:nF {#1}
      {
        \__unravel_print_message:nn { <| ~ }
          { \__unravel_str_truncate_left:nn {#1} { \g__unravel_max_output_int } }
      }
  }
\cs_new_protected:Npn \__unravel_print_state_prev:
  {
    \seq_set_map:NNn \l__unravel_tmpa_seq \g__unravel_prev_input_seq
      { \__unravel_to_str:n {##1} }
    \seq_remove_all:Nn \l__unravel_tmpa_seq { }
    \seq_if_empty:NTF \l__unravel_tmpa_seq
      { \__unravel_print_message:nn { || ~ } { } }
      {
        \seq_map_inline:Nn \l__unravel_tmpa_seq
          {
            \__unravel_print_message:nn { || ~ } {##1}
          }
      }
  }
\cs_new_protected:Npn \__unravel_print_state_input:
  {
    \__unravel_exp_args:Nx \__unravel_print_state_input:n
      { \__unravel_input_to_str: }
  }
\cs_new_protected:Npn \__unravel_print_state_input:n #1
  {
    \__unravel_print_message:nn { |> ~ }
      { \__unravel_str_truncate_right:nn {#1} { \g__unravel_max_input_int } }
  }
\cs_new_protected:Npn \__unravel_print_meaning:
  {
    \__unravel_input_if_empty:TF
      { \__unravel_print_message:nn { } { Empty~input! } }
      {
        \__unravel_input_get:N \l__unravel_tmpb_gtl
        \__unravel_print_message:nn { }
          {
            \gtl_head_do:NN \l__unravel_tmpb_gtl \token_to_str:N
            = \gtl_head_do:NN \l__unravel_tmpb_gtl \token_to_meaning:N
          }
      }
  }
\cs_new_protected:Npn \__unravel_print_action:
  { \__unravel_print_action_aux:N \g__unravel_trace_other_bool }
\cs_new_protected:Npn \__unravel_print_action:x #1
  {
    \__unravel_set_action_text:x {#1}
    \__unravel_print_action:
  }
\cs_new_protected:Npn \__unravel_print_assignment:
  { \__unravel_print_action_aux:N \g__unravel_trace_assigns_bool }
\cs_new_protected:Npn \__unravel_print_assignment:x #1
  {
    \__unravel_set_action_text:x {#1}
    \__unravel_print_assignment:
  }
\cs_new_protected:Npn \__unravel_print_expansion:
  { \__unravel_print_action_aux:N \g__unravel_trace_expansion_bool }
\cs_new_protected:Npn \__unravel_print_expansion:x #1
  {
    \__unravel_set_action_text:x {#1}
    \__unravel_print_expansion:
  }
\cs_new_protected:Npn \__unravel_print_action_aux:N #1
  {
    \int_gdecr:N \g__unravel_nonstop_int
    \int_gincr:N \g__unravel_step_int
    \bool_if:NT #1
      {
        \__unravel_print:x
          {
            [=====
            \bool_if:NT \g__unravel_number_steps_bool
              { ~ Step ~ \int_to_arabic:n { \g__unravel_step_int } ~ }
            =====]~
            \int_compare:nNnTF
              { \str_count:N \g__unravel_action_text_str }
              > { \g__unravel_max_action_int }
              {
                \str_range:Nnn \g__unravel_action_text_str
                  { 1 } { \g__unravel_max_action_int - 3 } ...
              }
              { \g__unravel_action_text_str }
          }
        \__unravel_print_state:
        \__unravel_prompt:
      }
  }
\cs_new_protected:Npn \__unravel_print_assigned_token:
  {
    \__unravel_after_assignment: % ^^A todo: simplify
    \__unravel_print_assignment:x
      {
        Set~ \exp_after:wN \token_to_str:N \l__unravel_defined_tl
        = \exp_after:wN \token_to_meaning:N \l__unravel_defined_tl
      }
    \__unravel_omit_after_assignment:w
  }
\cs_new_protected:Npn \__unravel_print_assigned_register:
  {
    \__unravel_after_assignment: % ^^A todo: simplify
    \__unravel_exp_args:Nx \__unravel_print_assignment:x
      {
        \exp_not:n
          {
            Set~ \exp_after:wN \token_to_str:N \l__unravel_defined_tl
            \tl_if_single:NT \l__unravel_defined_tl
              { ( \exp_after:wN \token_to_meaning:N \l__unravel_defined_tl ) }
          }
        = \exp_not:N \tl_to_str:n { \__unravel_the:w \l__unravel_defined_tl }
      }
    \__unravel_omit_after_assignment:w
  }
\cs_new_protected:Npn \__unravel_print_welcome:
  {
    \__unravel_print_message:nn { }
      {
        \bool_if:NTF \g__unravel_welcome_message_bool
          {
            \\
            ========~ Welcome~ to~ the~ unravel~ package~ ========\\
            \iow_indent:n
              {
                "<|"~ denotes~ the~ output~ to~ TeX's~ stomach. \\
                "||"~ denotes~ tokens~ waiting~ to~ be~ used. \\
                "|>"~ denotes~ tokens~ that~ we~ will~ act~ on. \\
                Press~<enter>~to~continue;~'h'~<enter>~for~help. \\
              }
          }
          { [=====~Start~=====] }
      }
    \__unravel_print_state:
    \__unravel_prompt:
  }
\cs_new_protected:Npn \__unravel_print_outcome:
  { \__unravel_print_message:nn { } { [=====~End~=====] } }
\cs_new_protected:Npn \__unravel_prompt:
  {
    \int_compare:nNnF \g__unravel_nonstop_int > 0
      {
        \group_begin:
          \__unravel_set_escapechar:n { -1 }
          \int_set:Nn \tex_endlinechar:D { -1 }
          \tl_use:N \g__unravel_before_prompt_tl
          \__unravel_prompt_aux:
        \group_end:
      }
  }
\cs_new_protected:Npn \__unravel_prompt_aux:
  {
    \int_compare:nNnT { \tex_interactionmode:D } = { 3 }
      {
        \bool_if:NTF \g__unravel_explicit_prompt_bool
          { \ior_str_get:Nc \c__unravel_prompt_ior }
          { \ior_str_get:Nc \c__unravel_noprompt_ior }
              { Your~input }
        \exp_args:Nv \__unravel_prompt_treat:n { Your~input }
      }
  }
\cs_new_protected:Npn \__unravel_prompt_treat:n #1
  {
    \tl_if_empty:nF {#1}
      {
        \__unravel_exp_args:Nx \str_case:nnF { \tl_head:n {#1} }
          {
            { m } { \__unravel_print_meaning: \__unravel_prompt_aux: }
            { q }
              {
                \int_gset:Nn \g__unravel_online_int { -1 }
                \int_gzero:N \g__unravel_nonstop_int
              }
            { x }
              {
                \group_end:
                \exp_after:wN \__unravel_exit:w \__unravel_exit:w
              }
            { X } { \tex_batchmode:D \tex_end:D }
            { s } { \__unravel_prompt_scan_int:nn {#1}
              \__unravel_prompt_silent_steps:n }
            { o } { \__unravel_prompt_scan_int:nn {#1}
              { \int_gset:Nn \g__unravel_online_int } }
            { C }
              {
                \__unravel_exp_args:Nx \use:n
                  {
                    \tl_gset_rescan:Nnn \exp_not:N \g__unravel_tmpc_tl
                      { \exp_not:N \ExplSyntaxOn } { \tl_tail:n {#1} }
                  }
                \tl_gput_left:Nn \g__unravel_tmpc_tl
                  { \tl_gclear:N \g__unravel_tmpc_tl }
                \group_insert_after:N \g__unravel_tmpc_tl
              }
            { | } { \__unravel_prompt_scan_int:nn {#1}
              \__unravel_prompt_vert:n }
            { a } { \__unravel_prompt_all: }
          }
          { \__unravel_prompt_help: }
      }
  }
\cs_new_protected:Npn \__unravel_prompt_scan_int:nn #1
  {
    \tex_afterassignment:D \__unravel_prompt_scan_int_after:wn
    \l__unravel_prompt_tmpa_int =
      \tl_if_head_eq_charcode:fNF { \use_none:n #1 } - { 0 }
      \use_ii:nn #1 \scan_stop:
  }
\cs_new_protected:Npn \__unravel_prompt_scan_int_after:wn #1 \scan_stop: #2
  {
    #2 \l__unravel_prompt_tmpa_int
    \tl_if_blank:nF {#1} { \__unravel_prompt_treat:n {#1} }
  }
\cs_new_protected:Npn \__unravel_prompt_help:
  {
    \__unravel_print:n { "m":~meaning~of~first~token }
    \__unravel_print:n { "q":~semi-quiet~(same~as~"o-1") }
    \__unravel_print:n { "x"/"X":~exit~this~instance~of~unravel/TeX }
    \__unravel_print:n { "s<num>":~do~<num>~steps~silently }
    \__unravel_print:n
      { "o<num>":~1~=>~log~and~terminal,~0~=>~only~log,~-1~=>~neither.}
    \__unravel_print:n { "C<code>":~run~some~expl3~code~immediately }
    \__unravel_print:n { "|<num>":~silent~steps~until~<num>~fewer~"||" }
    \__unravel_print:n { "a":~print~state~again,~without~truncating }
    \__unravel_prompt_aux:
  }
\cs_new_protected:Npn \__unravel_prompt_silent_steps:n #1
  {
    \int_compare:nNnF {#1} < 0
      {
        \int_gset:Nn \g__unravel_online_int { -1 }
        \tl_gset:Nn \g__unravel_before_prompt_tl
          {
            \int_gset:Nn \g__unravel_online_int { 1 }
            \tl_gclear:N \g__unravel_before_prompt_tl
          }
        \int_gset:Nn \g__unravel_nonstop_int {#1}
      }
  }
\cs_new_protected:Npn \__unravel_prompt_vert:n #1
  {
    \int_compare:nNnTF {#1} < { 0 }
      { \__unravel_prompt_vert:Nn > {#1} }
      { \__unravel_prompt_vert:Nn < {#1} }
  }
\cs_new_protected:Npn \__unravel_prompt_vert:Nn #1#2
  {
    \int_gset:Nn \g__unravel_online_int { -1 }
    \tl_gset:Nf \g__unravel_before_print_state_tl
      {
        \exp_args:NNf \exp_stop_f: \int_compare:nNnTF
          { \int_eval:n { \__unravel_prev_input_count: - #2 } }
          #1 { \__unravel_prev_input_count: }
          {
            \int_gset:Nn \g__unravel_nonstop_int
              { \int_max:nn { \g__unravel_nonstop_int } { 2 } }
          }
          {
            \int_gset:Nn \g__unravel_online_int { 1 }
            \tl_gclear:N \g__unravel_before_print_state_tl
          }
      }
  }
\cs_new_protected:Npn \__unravel_prompt_all:
  {
    \tl_gset:Nx \g__unravel_tmpc_tl
      {
        \exp_not:n
          {
            \tl_gclear:N \g__unravel_tmpc_tl
            \int_gset_eq:NN \g__unravel_max_output_int \c_max_int
            \int_gset_eq:NN \g__unravel_max_input_int \c_max_int
            \__unravel_print_state:
            \int_gdecr:N \g__unravel_nonstop_int
            \__unravel_prompt:
          }
        \__unravel_prompt_all_aux:N \g__unravel_max_output_int
        \__unravel_prompt_all_aux:N \g__unravel_max_input_int
      }
    \group_insert_after:N \g__unravel_tmpc_tl
  }
\cs_new:Npn \__unravel_prompt_all_aux:N #1
  { \exp_not:n { \int_gset:Nn #1 } { \int_use:N #1 } }
\cs_new_protected:Npn \__unravel_not_implemented:n #1
  { \__unravel_error:nnnnn { not-implemented } {#1} { } { } { } }
\cs_new_protected:Npn \__unravel_error:nnnnn #1#2#3#4#5
  {
    \group_begin:
    \msg_error:nnnnnn { unravel } {#1} {#2} {#3} {#4} {#5}
    \group_end:
  }
\cs_new_protected:Npn \__unravel_error:nxxxx #1#2#3#4#5
  {
    \group_begin:
    \msg_error:nnxxxx { unravel } {#1} {#2} {#3} {#4} {#5}
    \group_end:
  }
\cs_new_protected:Npn \__unravel_tex_msg_new:nnn #1#2#3
  {
    \cs_new:cpn { __unravel_tex_msg_error_#1: } {#2}
    \cs_new:cpn { __unravel_tex_msg_help_#1: } {#3}
  }
\cs_new_protected:Npn \__unravel_tex_error:nn #1#2
  {
    \group_begin:
    \msg_error:nnxxx { unravel } { tex-error }
      { \tl_to_str:n {#2} }
      { \use:c { __unravel_tex_msg_error_#1: } }
      { \use:c { __unravel_tex_msg_help_#1: } }
    \group_end:
  }
\cs_generate_variant:Nn \__unravel_tex_error:nn { nV }
\cs_new_protected:Npn \__unravel_tex_fatal_error:nn #1#2
  {
    \__unravel_error:nxxxx { tex-fatal }
      { \tl_to_str:n {#2} }
      { \use:c { __unravel_tex_msg_error_#1: } }
      { \use:c { __unravel_tex_msg_help_#1: } }
      { }
  }
\cs_generate_variant:Nn \__unravel_tex_fatal_error:nn { nV }
\keys_define:nn { unravel/defaults }
  {
    explicit-prompt  .bool_gset:N = \g__unravel_default_explicit_prompt_bool ,
    internal-debug   .bool_gset:N = \g__unravel_default_internal_debug_bool ,
    max-action       .int_gset:N  = \g__unravel_default_max_action_int ,
    max-output       .int_gset:N  = \g__unravel_default_max_output_int ,
    max-input        .int_gset:N  = \g__unravel_default_max_input_int ,
    number-steps     .bool_gset:N = \g__unravel_default_number_steps_bool ,
    online           .int_gset:N  = \g__unravel_default_online_int ,
    trace-assigns    .bool_gset:N = \g__unravel_default_trace_assign_bool ,
    trace-expansion  .bool_gset:N = \g__unravel_default_trace_expansion_bool ,
    trace-other      .bool_gset:N = \g__unravel_default_trace_other_bool ,
    welcome-message  .bool_gset:N = \g__unravel_default_welcome_message_bool ,
  }
\keys_define:nn { unravel }
  {
    explicit-prompt  .bool_gset:N = \g__unravel_explicit_prompt_bool ,
    internal-debug   .bool_gset:N = \g__unravel_internal_debug_bool ,
    max-action       .int_gset:N  = \g__unravel_max_action_int ,
    max-output       .int_gset:N  = \g__unravel_max_output_int ,
    max-input        .int_gset:N  = \g__unravel_max_input_int ,
    number-steps     .bool_gset:N = \g__unravel_number_steps_bool ,
    online           .int_gset:N  = \g__unravel_online_int ,
    trace-assigns    .bool_gset:N = \g__unravel_trace_assigns_bool ,
    trace-expansion  .bool_gset:N = \g__unravel_trace_expansion_bool ,
    trace-other      .bool_gset:N = \g__unravel_trace_other_bool ,
    welcome-message  .bool_gset:N = \g__unravel_welcome_message_bool ,
  }
\tl_map_inline:nn { { /defaults } { } }
  {
    \keys_define:nn { unravel #1 }
      {
        machine        .meta:nn =
          { unravel #1 }
          {
            explicit-prompt = false ,
            internal-debug  = false ,
            max-action      = \c_max_int ,
            max-output      = \c_max_int ,
            max-input       = \c_max_int ,
            number-steps    = false ,
            welcome-message = false ,
          } ,
        mute          .meta:nn =
          { unravel #1 }
          {
            trace-assigns = false ,
            trace-expansion = false ,
            trace-other = false ,
            welcome-message = false ,
            online = -1 ,
          }
      }
  }
\NewDocumentCommand \unravel { O { } +m } { \unravel:nn {#1} {#2} }
\NewDocumentCommand \unravelsetup { m } { \unravel_setup:n {#1} }
\cs_new_protected:Npn \unravel_setup:n #1
  {
    \keys_set:nn { unravel/defaults } {#1}
    \keys_set:nn { unravel } {#1}
  }
\cs_new_protected:Npn \unravel:nn { \__unravel_unravel_marker: \__unravel:nn }
\cs_new_eq:NN \__unravel_unravel_marker: \__unravel_special_relax:
\cs_new_protected:Npn \__unravel:nn #1#2
  {
    \__unravel_init_key_vars:
    \keys_set:nn { unravel } {#1}
    \__unravel_init_vars:
    \__unravel_input_gset:n {#2}
    \__unravel_print_welcome:
    \__unravel_main_loop:
    \__unravel_exit_point:
    \__unravel_print_outcome:
    \__unravel_final_test:
    \__unravel_exit_point:
  }
\cs_new_protected:Npn \unravel_get:nnN #1#2#3
  {
    \unravel:nn {#1} {#2}
    \tl_set:Nx #3 { \gtl_left_tl:N \g__unravel_output_gtl }
  }
\cs_new_protected:Npn \__unravel_init_key_vars:
  {
    \bool_gset_eq:NN \g__unravel_explicit_prompt_bool \g__unravel_default_explicit_prompt_bool
    \bool_gset_eq:NN \g__unravel_internal_debug_bool \g__unravel_default_internal_debug_bool
    \bool_gset_eq:NN \g__unravel_number_steps_bool \g__unravel_default_number_steps_bool
    \int_gset_eq:NN  \g__unravel_online_int \g__unravel_default_online_int
    \bool_gset_eq:NN \g__unravel_trace_assigns_bool \g__unravel_default_trace_assigns_bool
    \bool_gset_eq:NN \g__unravel_trace_expansion_bool \g__unravel_default_trace_expansion_bool
    \bool_gset_eq:NN \g__unravel_trace_other_bool \g__unravel_default_trace_other_bool
    \bool_gset_eq:NN \g__unravel_welcome_message_bool \g__unravel_default_welcome_message_bool
    \int_gset_eq:NN \g__unravel_max_action_int \g__unravel_default_max_action_int
    \int_gset_eq:NN \g__unravel_max_output_int \g__unravel_default_max_output_int
    \int_gset_eq:NN \g__unravel_max_input_int  \g__unravel_default_max_input_int
    \int_gzero:N \g__unravel_nonstop_int
  }
\cs_new_protected:Npn \__unravel_init_vars:
  {
    \seq_gclear:N \g__unravel_prev_input_seq
    \gtl_gclear:N \g__unravel_output_gtl
    \int_gzero:N  \g__unravel_step_int
    \tl_gclear:N  \g__unravel_if_limit_tl
    \int_gzero:N  \g__unravel_if_limit_int
    \int_gzero:N  \g__unravel_if_depth_int
    \gtl_gclear:N \g__unravel_after_assignment_gtl
    \bool_gset_true:N  \g__unravel_set_box_allowed_bool
    \bool_gset_false:N \g__unravel_name_in_progress_bool
    \gtl_clear:N \l__unravel_after_group_gtl
  }
\cs_new_protected:Npn \__unravel_main_loop:
  {
    \__unravel_get_x_next:
    \__unravel_set_cmd:
    \__unravel_do_step:
    \__unravel_main_loop:
  }
\cs_new_protected:Npn \__unravel_final_test:
  {
    \bool_if:nTF
      {
        \tl_if_empty_p:N \g__unravel_if_limit_tl
        && \int_compare_p:nNn \g__unravel_if_limit_int = 0
        && \int_compare_p:nNn \g__unravel_if_depth_int = 0
        && \seq_if_empty_p:N \g__unravel_prev_input_seq
      }
      { \__unravel_input_if_empty:TF { } { \__unravel_final_bad: } }
      { \__unravel_final_bad: }
  }
\cs_new_protected:Npn \__unravel_final_bad:
  {
    \__unravel_error:nnnnn { internal }
      { the-last-unravel-finished-badly } { } { } { }
  }
\msg_new:nnn { unravel } { unknown-primitive }
  { Internal~error:~the~primitive~'#1'~is~not~known. }
\msg_new:nnn { unravel } { extra-fi-or-else }
  { Extra~fi,~or,~or~else. }
\msg_new:nnn { unravel } { missing-dollar }
  { Missing~dollar~inserted. }
\msg_new:nnn { unravel } { unknown-expandable }
  { Internal~error:~the~expandable~command~'#1'~is~not~known. }
\msg_new:nnn { unravel } { missing-font-id }
  { Missing~font~identifier.~\iow_char:N\\nullfont~inserted. }
\msg_new:nnn { unravel } { missing-rparen }
  { Missing~right~parenthesis~inserted~for~expression. }
\msg_new:nnn { unravel } { missing-cs }
  { Missing~control~sequence.~\iow_char:N\\inaccessible~inserted. }
\msg_new:nnn { unravel } { missing-box }
  { Missing~box~inserted. }
\msg_new:nnn { unravel } { missing-to }
  { Missing~keyword~'to'~inserted. }
\msg_new:nnn { unravel } { improper-leaders }
  { Leaders~not~followed~by~proper~glue. }
\msg_new:nnn { unravel } { extra-close }
  { Extra~right~brace~or~\iow_char:N\\endgroup. }
\msg_new:nnn { unravel } { off-save }
  { Something~is~wrong~with~groups. }
\msg_new:nnn { unravel } { hrule-bad-mode }
  { \iow_char\\hrule~used~in~wrong~mode. }
\msg_new:nnn { unravel } { invalid-mode }
  { Invalid~mode~for~this~command. }
\msg_new:nnn { unravel } { color-stack-action-missing }
  { Missing~color~stack~action. }
\msg_new:nnn { unravel } { action-type-missing }
  { Missing~action~type. }
\msg_new:nnn { unravel } { identifier-type-missing }
  { Missing~identifier~type. }
\msg_new:nnn { unravel } { destination-type-missing }
  { Missing~destination~type. }
\msg_new:nnn { unravel } { erroneous-prefixes }
  { Prefixes~appplied~to~non-assignment~command. }
\msg_new:nnn { unravel } { improper-setbox }
  { \iow_char:N\\setbox~while~fetching~base~of~an~accent. }
\msg_new:nnn { unravel } { after-advance }
  {
    Missing~register~after~\iow_char:N\\advance,~
    \iow_char:N\\multiply,~or~\iow_char:N\\divide.
  }
\msg_new:nnn { unravel } { bad-unless }
  { \iow_char:N\\unless~not~followed~by~conditional. }
\msg_new:nnn { unravel } { runaway-if }
  { Runaway~\iow_char:N\\if... }
\msg_new:nnn { unravel } { runaway-macro-parameter }
  {
    Runaway~macro~parameter~\# #2~after \\\\
    \iow_indent:n {#1}
  }
\msg_new:nnn { unravel } { extra-or }
  { Extra~\iow_char:N\\or. }
\msg_new:nnn { unravel } { missing-equals }
  { Missing~equals~for~\iow_char:N\\ifnum~or~\iow_char:N\\ifdim. }
\msg_new:nnn { unravel } { internal }
  { Internal~error:~'#1'.~\ Please~report. }
\msg_new:nnn { unravel } { not-implemented }
  { The~following~feature~is~not~implemented:~'#1'. }
\msg_new:nnn { unravel } { endinput-ignored }
  { The~primitive~\iow_char:N\\endinput~was~ignored. }
\msg_new:nnn { unravel } { missing-something }
  { Something~is~missing,~sorry! }
\msg_new:nnn { unravel } { nested-unravel }
  { The~\iow_char:N\\unravel~command~may~not~be~nested. }
\msg_new:nnnn { unravel } { tex-error }
  { TeX~sees~"#1"~and~throws~an~error:\\\\ \iow_indent:n {#2} }
  {
    \tl_if_empty:nTF {#3}
      { TeX~provides~no~further~help~for~this~error. }
      { TeX's~advice~is:\\\\ \iow_indent:n {#3} }
  }
\msg_new:nnnn { unravel } { tex-fatal }
  { TeX~sees~"#1"~and~throws~a~fatal~error:\\\\ \iow_indent:n {#2} }
  {
    \tl_if_empty:nTF {#3}
      { TeX~provides~no~further~help~for~this~error. }
      { TeX's~advice~is:\\\\ \iow_indent:n {#3} }
  }
\__unravel_tex_msg_new:nnn { incompatible-mag }
  {
    Incompatible~magnification~
    ( \int_to_arabic:n { \__unravel_mag: } );~
    the~previous~value~will~be~retained
  }
  {
    I~can~handle~only~one~magnification~ratio~per~job.~So~I've~
    reverted~to~the~magnification~you~used~earlier~on~this~run.
  }
\__unravel_tex_msg_new:nnn { illegal-mag }
  {
    Illegal~magnification~has~been~changed~to~1000~
    ( \int_to_arabic:n { \__unravel_mag: } )
  }
  { The~magnification~ratio~must~be~between~1~and~32768. }
\__unravel_tex_msg_new:nnn { missing-number }
  { Missing~number,~treated~as~zero }
  {
    A~number~should~have~been~here;~I~inserted~`0'.~
    If~you~can't~figure~out~why~I~needed~to~see~a~number,~
    look~up~`weird~error'~in~the~index~to~The~TeXbook.
  }
\__unravel_tex_msg_new:nnn { the-cannot }
  { You~can't~use~`\tl_to_str:N\l__unravel_head_tl'~after~\iow_char:N\\the }
  { I'm~forgetting~what~you~said~and~using~zero~instead. }
\__unravel_tex_msg_new:nnn { incompatible-units }
  { Incompatible~glue~units }
  { I'm~going~to~assume~that~1mu=1pt~when~they're~mixed. }
\__unravel_tex_msg_new:nnn { missing-mu }
  { Illegal~unit~of~measure~(mu~inserted) }
  {
    The~unit~of~measurement~in~math~glue~must~be~mu.~
    To~recover~gracefully~from~this~error,~it's~best~to~
    delete~the~erroneous~units;~e.g.,~type~`2'~to~delete~
    two~letters.~(See~Chapter~27~of~The~TeXbook.)
  }
\__unravel_tex_msg_new:nnn { missing-pt }
  { Illegal~unit~of~measure~(pt~inserted) }
  {
    Dimensions~can~be~in~units~of~em,~ex,~in,~pt,~pc,~
    cm,~mm,~dd,~cc,~nd,~nc,~bp,~or~sp;~but~yours~is~a~new~one!~
    I'll~assume~that~you~meant~to~say~pt,~for~printer's~points.~
    To~recover~gracefully~from~this~error,~it's~best~to~
    delete~the~erroneous~units;~e.g.,~type~`2'~to~delete~
    two~letters.~(See~Chapter~27~of~The~TeXbook.)
  }
\__unravel_tex_msg_new:nnn { missing-lbrace }
  { Missing~\iow_char:N\{~inserted }
  {
    A~left~brace~was~mandatory~here,~so~I've~put~one~in.~
    You~might~want~to~delete~and/or~insert~some~corrections~
    so~that~I~will~find~a~matching~right~brace~soon.~
    (If~you're~confused~by~all~this,~try~typing~`I\iow_char:N\}'~now.)
  }
\__unravel_tex_msg_new:nnn { extra-endcsname }
  { Extra~\token_to_str:c{endcsname} }
  { I'm~ignoring~this,~since~I~wasn't~doing~a~\token_to_str:c{csname}. }
\__unravel_tex_msg_new:nnn { missing-endcsname }
  { Missing~\token_to_str:c{endcsname}~inserted }
  {
    The~control~sequence~marked~<to~be~read~again>~should~
    not~appear~between~\token_to_str:c{csname}~and~
    \token_to_str:c{endcsname}.
  }
\__unravel_tex_msg_new:nnn { cannot-read }
  { ***~(cannot~\iow_char:N\\read~from~terminal~in~nonstop~modes) }
  { }
\__unravel_tex_msg_new:nnn { file-error }
  { ***~(job~aborted,~file~error~in~nonstop~mode) }
  { }
\__unravel_tex_msg_new:nnn { interwoven-preambles }
  { (interwoven~alignment~preambles~are~not~allowed) }
  { }
\__unravel_setup_restore:
%% 
%%
%% End of file `unravel.sty'.
