empty_ref.pl 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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{'empty_ref'} = {
  7. 'contents' => [
  8. {
  9. 'parent' => {},
  10. 'text' => '
  11. ',
  12. 'type' => 'empty_line'
  13. },
  14. {
  15. 'contents' => [
  16. {
  17. 'args' => [
  18. {
  19. 'contents' => [],
  20. 'parent' => {},
  21. 'type' => 'brace_command_arg'
  22. }
  23. ],
  24. 'cmdname' => 'ref',
  25. 'contents' => [],
  26. 'extra' => {
  27. 'brace_command_contents' => [
  28. undef
  29. ]
  30. },
  31. 'line_nr' => {
  32. 'file_name' => '',
  33. 'line_nr' => 2,
  34. 'macro' => ''
  35. },
  36. 'parent' => {}
  37. },
  38. {
  39. 'parent' => {},
  40. 'text' => ' '
  41. },
  42. {
  43. 'args' => [
  44. {
  45. 'contents' => [],
  46. 'parent' => {},
  47. 'type' => 'brace_command_arg'
  48. },
  49. {
  50. 'contents' => [],
  51. 'parent' => {},
  52. 'type' => 'brace_command_arg'
  53. },
  54. {
  55. 'contents' => [
  56. {
  57. 'parent' => {},
  58. 'text' => 'something'
  59. }
  60. ],
  61. 'parent' => {},
  62. 'type' => 'brace_command_arg'
  63. }
  64. ],
  65. 'cmdname' => 'xref',
  66. 'contents' => [],
  67. 'extra' => {
  68. 'brace_command_contents' => [
  69. undef,
  70. undef,
  71. [
  72. {}
  73. ]
  74. ]
  75. },
  76. 'line_nr' => {},
  77. 'parent' => {}
  78. },
  79. {
  80. 'parent' => {},
  81. 'text' => '. '
  82. },
  83. {
  84. 'args' => [
  85. {
  86. 'contents' => [
  87. {
  88. 'parent' => {},
  89. 'text' => ' ',
  90. 'type' => 'empty_spaces_before_argument'
  91. }
  92. ],
  93. 'parent' => {},
  94. 'type' => 'brace_command_arg'
  95. }
  96. ],
  97. 'cmdname' => 'inforef',
  98. 'contents' => [],
  99. 'extra' => {
  100. 'brace_command_contents' => [
  101. undef
  102. ],
  103. 'spaces_before_argument' => {}
  104. },
  105. 'line_nr' => {},
  106. 'parent' => {}
  107. },
  108. {
  109. 'parent' => {},
  110. 'text' => '
  111. '
  112. },
  113. {
  114. 'parent' => {},
  115. 'text' => ' '
  116. },
  117. {
  118. 'args' => [
  119. {
  120. 'contents' => [
  121. {
  122. 'parent' => {},
  123. 'text' => ' ',
  124. 'type' => 'empty_spaces_before_argument'
  125. }
  126. ],
  127. 'parent' => {},
  128. 'type' => 'brace_command_arg'
  129. },
  130. {
  131. 'contents' => [
  132. {
  133. 'parent' => {},
  134. 'text' => ' ',
  135. 'type' => 'empty_spaces_before_argument'
  136. },
  137. {
  138. 'parent' => {},
  139. 'text' => 'arg'
  140. }
  141. ],
  142. 'parent' => {},
  143. 'type' => 'brace_command_arg'
  144. }
  145. ],
  146. 'cmdname' => 'inforef',
  147. 'contents' => [],
  148. 'extra' => {
  149. 'brace_command_contents' => [
  150. undef,
  151. [
  152. {}
  153. ]
  154. ],
  155. 'spaces_before_argument' => {}
  156. },
  157. 'line_nr' => {
  158. 'file_name' => '',
  159. 'line_nr' => 3,
  160. 'macro' => ''
  161. },
  162. 'parent' => {}
  163. },
  164. {
  165. 'parent' => {},
  166. 'text' => '.
  167. '
  168. }
  169. ],
  170. 'parent' => {},
  171. 'type' => 'paragraph'
  172. }
  173. ],
  174. 'type' => 'text_root'
  175. };
  176. $result_trees{'empty_ref'}{'contents'}[0]{'parent'} = $result_trees{'empty_ref'};
  177. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[0];
  178. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  179. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[1]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  180. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2];
  181. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[1]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2];
  182. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[2]{'contents'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[2];
  183. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[2]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2];
  184. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'extra'}{'brace_command_contents'}[2][0] = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'args'}[2]{'contents'}[0];
  185. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'line_nr'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[0]{'line_nr'};
  186. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[2]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  187. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[3]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  188. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'args'}[0];
  189. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'args'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4];
  190. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'extra'}{'spaces_before_argument'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'args'}[0]{'contents'}[0];
  191. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'line_nr'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[0]{'line_nr'};
  192. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[4]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  193. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[5]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  194. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[6]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  195. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[0]{'contents'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[0];
  196. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7];
  197. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1]{'contents'}[0]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1];
  198. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1]{'contents'}[1]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1];
  199. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7];
  200. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'extra'}{'brace_command_contents'}[1][0] = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[1]{'contents'}[1];
  201. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'extra'}{'spaces_before_argument'} = $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'args'}[0]{'contents'}[0];
  202. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[7]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  203. $result_trees{'empty_ref'}{'contents'}[1]{'contents'}[8]{'parent'} = $result_trees{'empty_ref'}{'contents'}[1];
  204. $result_trees{'empty_ref'}{'contents'}[1]{'parent'} = $result_trees{'empty_ref'};
  205. $result_texis{'empty_ref'} = '
  206. @ref{} @xref{,,something}. @inforef{ }
  207. @inforef{ , arg}.
  208. ';
  209. $result_texts{'empty_ref'} = '
  210. .
  211. .
  212. ';
  213. $result_errors{'empty_ref'} = [
  214. {
  215. 'error_line' => ':2: warning: command @ref missing a node or external manual argument
  216. ',
  217. 'file_name' => '',
  218. 'line_nr' => 2,
  219. 'macro' => '',
  220. 'text' => 'command @ref missing a node or external manual argument',
  221. 'type' => 'warning'
  222. },
  223. {
  224. 'error_line' => ':2: warning: command @xref missing a node or external manual argument
  225. ',
  226. 'file_name' => '',
  227. 'line_nr' => 2,
  228. 'macro' => '',
  229. 'text' => 'command @xref missing a node or external manual argument',
  230. 'type' => 'warning'
  231. },
  232. {
  233. 'error_line' => ':2: warning: command @inforef missing a node or external manual argument
  234. ',
  235. 'file_name' => '',
  236. 'line_nr' => 2,
  237. 'macro' => '',
  238. 'text' => 'command @inforef missing a node or external manual argument',
  239. 'type' => 'warning'
  240. },
  241. {
  242. 'error_line' => ':3: warning: command @inforef missing a node or external manual argument
  243. ',
  244. 'file_name' => '',
  245. 'line_nr' => 3,
  246. 'macro' => '',
  247. 'text' => 'command @inforef missing a node or external manual argument',
  248. 'type' => 'warning'
  249. }
  250. ];
  251. 1;