protect_in_body_line_arg.pl 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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{'protect_in_body_line_arg'} = {
  7. 'contents' => [
  8. {
  9. 'args' => [
  10. {
  11. 'parent' => {},
  12. 'text' => 'macroone',
  13. 'type' => 'macro_name'
  14. },
  15. {
  16. 'parent' => {},
  17. 'text' => 'arg1',
  18. 'type' => 'macro_arg'
  19. },
  20. {
  21. 'parent' => {},
  22. 'text' => 'arg2',
  23. 'type' => 'macro_arg'
  24. }
  25. ],
  26. 'cmdname' => 'macro',
  27. 'contents' => [
  28. {
  29. 'parent' => {},
  30. 'text' => 'result: @emph{\\arg1\\} protected \\\\ -> \\\\arg1\\\\ @emph{\\arg2\\}',
  31. 'type' => 'raw'
  32. },
  33. {
  34. 'parent' => {},
  35. 'text' => '
  36. ',
  37. 'type' => 'last_raw_newline'
  38. }
  39. ],
  40. 'extra' => {
  41. 'arg_line' => ' macroone { arg1 , arg2 }
  42. '
  43. },
  44. 'line_nr' => {
  45. 'file_name' => '',
  46. 'line_nr' => 1,
  47. 'macro' => ''
  48. },
  49. 'parent' => {}
  50. },
  51. {
  52. 'extra' => {
  53. 'command' => {}
  54. },
  55. 'parent' => {},
  56. 'text' => '
  57. ',
  58. 'type' => 'empty_line_after_command'
  59. },
  60. {
  61. 'parent' => {},
  62. 'text' => '
  63. ',
  64. 'type' => 'empty_line'
  65. },
  66. {
  67. 'contents' => [
  68. {
  69. 'parent' => {},
  70. 'text' => 'result: '
  71. },
  72. {
  73. 'args' => [
  74. {
  75. 'contents' => [],
  76. 'parent' => {},
  77. 'type' => 'brace_command_arg'
  78. }
  79. ],
  80. 'cmdname' => 'emph',
  81. 'contents' => [],
  82. 'line_nr' => {
  83. 'file_name' => '',
  84. 'line_nr' => 5,
  85. 'macro' => 'macroone'
  86. },
  87. 'parent' => {}
  88. },
  89. {
  90. 'parent' => {},
  91. 'text' => ' protected \\ -> \\arg1\\ '
  92. },
  93. {
  94. 'args' => [
  95. {
  96. 'contents' => [],
  97. 'parent' => {},
  98. 'type' => 'brace_command_arg'
  99. }
  100. ],
  101. 'cmdname' => 'emph',
  102. 'contents' => [],
  103. 'line_nr' => {},
  104. 'parent' => {}
  105. },
  106. {
  107. 'parent' => {},
  108. 'text' => ' '
  109. },
  110. {
  111. 'args' => [
  112. {
  113. 'contents' => [
  114. {
  115. 'parent' => {},
  116. 'text' => 'f\\irst arg'
  117. }
  118. ],
  119. 'parent' => {},
  120. 'type' => 'brace_command_arg'
  121. }
  122. ],
  123. 'cmdname' => 'samp',
  124. 'contents' => [],
  125. 'line_nr' => {
  126. 'file_name' => '',
  127. 'line_nr' => 5,
  128. 'macro' => ''
  129. },
  130. 'parent' => {}
  131. },
  132. {
  133. 'parent' => {},
  134. 'text' => ', second arg
  135. '
  136. }
  137. ],
  138. 'parent' => {},
  139. 'type' => 'paragraph'
  140. }
  141. ],
  142. 'type' => 'text_root'
  143. };
  144. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  145. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'args'}[1]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  146. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'args'}[2]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  147. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'contents'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  148. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'contents'}[1]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  149. $result_trees{'protect_in_body_line_arg'}{'contents'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'};
  150. $result_trees{'protect_in_body_line_arg'}{'contents'}[1]{'extra'}{'command'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[0];
  151. $result_trees{'protect_in_body_line_arg'}{'contents'}[1]{'parent'} = $result_trees{'protect_in_body_line_arg'};
  152. $result_trees{'protect_in_body_line_arg'}{'contents'}[2]{'parent'} = $result_trees{'protect_in_body_line_arg'};
  153. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  154. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[1]{'args'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[1];
  155. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[1]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  156. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[2]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  157. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[3]{'args'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[3];
  158. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[3]{'line_nr'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[1]{'line_nr'};
  159. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[3]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  160. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[4]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  161. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[5]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[5]{'args'}[0];
  162. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[5]{'args'}[0]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[5];
  163. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[5]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  164. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'contents'}[6]{'parent'} = $result_trees{'protect_in_body_line_arg'}{'contents'}[3];
  165. $result_trees{'protect_in_body_line_arg'}{'contents'}[3]{'parent'} = $result_trees{'protect_in_body_line_arg'};
  166. $result_texis{'protect_in_body_line_arg'} = '@macro macroone { arg1 , arg2 }
  167. result: @emph{\\arg1\\} protected \\\\ -> \\\\arg1\\\\ @emph{\\arg2\\}
  168. @end macro
  169. result: @emph{} protected \\ -> \\arg1\\ @emph{} @samp{f\\irst arg}, second arg
  170. ';
  171. $result_texts{'protect_in_body_line_arg'} = '
  172. result: protected \\ -> \\arg1\\ f\\irst arg, second arg
  173. ';
  174. $result_errors{'protect_in_body_line_arg'} = [
  175. {
  176. 'error_line' => ':5: warning: @macroone defined with zero or more than one argument should be invoked with {}
  177. ',
  178. 'file_name' => '',
  179. 'line_nr' => 5,
  180. 'macro' => '',
  181. 'text' => '@macroone defined with zero or more than one argument should be invoked with {}',
  182. 'type' => 'warning'
  183. }
  184. ];
  185. 1;