macro_expands_to_empty.pl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. use vars qw(%result_texis %result_texts %result_trees %result_errors
  2. %result_indices %result_sectioning %result_nodes %result_menus
  3. %result_floats %result_converted %result_converted_errors
  4. %result_elements %result_directions_text);
  5. use utf8;
  6. $result_trees{'macro_expands_to_empty'} = {
  7. 'contents' => [
  8. {
  9. 'args' => [
  10. {
  11. 'parent' => {},
  12. 'text' => 'foo',
  13. 'type' => 'macro_name'
  14. },
  15. {
  16. 'parent' => {},
  17. 'text' => 'arg',
  18. 'type' => 'macro_arg'
  19. }
  20. ],
  21. 'cmdname' => 'macro',
  22. 'contents' => [
  23. {
  24. 'parent' => {},
  25. 'text' => '\\arg\\',
  26. 'type' => 'raw'
  27. },
  28. {
  29. 'parent' => {},
  30. 'text' => '
  31. ',
  32. 'type' => 'last_raw_newline'
  33. }
  34. ],
  35. 'extra' => {
  36. 'arg_line' => ' foo {arg}
  37. '
  38. },
  39. 'line_nr' => {
  40. 'file_name' => '',
  41. 'line_nr' => 1,
  42. 'macro' => ''
  43. },
  44. 'parent' => {}
  45. },
  46. {
  47. 'extra' => {
  48. 'command' => {}
  49. },
  50. 'parent' => {},
  51. 'text' => '
  52. ',
  53. 'type' => 'empty_line_after_command'
  54. },
  55. {
  56. 'parent' => {},
  57. 'text' => '
  58. ',
  59. 'type' => 'empty_line'
  60. },
  61. {
  62. 'parent' => {},
  63. 'text' => '
  64. ',
  65. 'type' => 'empty_line'
  66. },
  67. {
  68. 'contents' => [
  69. {
  70. 'parent' => {},
  71. 'text' => 'aa
  72. '
  73. }
  74. ],
  75. 'parent' => {},
  76. 'type' => 'paragraph'
  77. }
  78. ],
  79. 'type' => 'text_root'
  80. };
  81. $result_trees{'macro_expands_to_empty'}{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'macro_expands_to_empty'}{'contents'}[0];
  82. $result_trees{'macro_expands_to_empty'}{'contents'}[0]{'args'}[1]{'parent'} = $result_trees{'macro_expands_to_empty'}{'contents'}[0];
  83. $result_trees{'macro_expands_to_empty'}{'contents'}[0]{'contents'}[0]{'parent'} = $result_trees{'macro_expands_to_empty'}{'contents'}[0];
  84. $result_trees{'macro_expands_to_empty'}{'contents'}[0]{'contents'}[1]{'parent'} = $result_trees{'macro_expands_to_empty'}{'contents'}[0];
  85. $result_trees{'macro_expands_to_empty'}{'contents'}[0]{'parent'} = $result_trees{'macro_expands_to_empty'};
  86. $result_trees{'macro_expands_to_empty'}{'contents'}[1]{'extra'}{'command'} = $result_trees{'macro_expands_to_empty'}{'contents'}[0];
  87. $result_trees{'macro_expands_to_empty'}{'contents'}[1]{'parent'} = $result_trees{'macro_expands_to_empty'};
  88. $result_trees{'macro_expands_to_empty'}{'contents'}[2]{'parent'} = $result_trees{'macro_expands_to_empty'};
  89. $result_trees{'macro_expands_to_empty'}{'contents'}[3]{'parent'} = $result_trees{'macro_expands_to_empty'};
  90. $result_trees{'macro_expands_to_empty'}{'contents'}[4]{'contents'}[0]{'parent'} = $result_trees{'macro_expands_to_empty'}{'contents'}[4];
  91. $result_trees{'macro_expands_to_empty'}{'contents'}[4]{'parent'} = $result_trees{'macro_expands_to_empty'};
  92. $result_texis{'macro_expands_to_empty'} = '@macro foo {arg}
  93. \\arg\\
  94. @end macro
  95. aa
  96. ';
  97. $result_texts{'macro_expands_to_empty'} = '
  98. aa
  99. ';
  100. $result_errors{'macro_expands_to_empty'} = [];
  101. 1;