arg_not_closed.pl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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{'arg_not_closed'} = {
  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' => 'foo',
  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. 'contents' => [
  63. {
  64. 'parent' => {},
  65. 'text' => 'call foo
  66. '
  67. }
  68. ],
  69. 'parent' => {},
  70. 'type' => 'paragraph'
  71. }
  72. ],
  73. 'type' => 'text_root'
  74. };
  75. $result_trees{'arg_not_closed'}{'contents'}[0]{'args'}[0]{'parent'} = $result_trees{'arg_not_closed'}{'contents'}[0];
  76. $result_trees{'arg_not_closed'}{'contents'}[0]{'args'}[1]{'parent'} = $result_trees{'arg_not_closed'}{'contents'}[0];
  77. $result_trees{'arg_not_closed'}{'contents'}[0]{'contents'}[0]{'parent'} = $result_trees{'arg_not_closed'}{'contents'}[0];
  78. $result_trees{'arg_not_closed'}{'contents'}[0]{'contents'}[1]{'parent'} = $result_trees{'arg_not_closed'}{'contents'}[0];
  79. $result_trees{'arg_not_closed'}{'contents'}[0]{'parent'} = $result_trees{'arg_not_closed'};
  80. $result_trees{'arg_not_closed'}{'contents'}[1]{'extra'}{'command'} = $result_trees{'arg_not_closed'}{'contents'}[0];
  81. $result_trees{'arg_not_closed'}{'contents'}[1]{'parent'} = $result_trees{'arg_not_closed'};
  82. $result_trees{'arg_not_closed'}{'contents'}[2]{'parent'} = $result_trees{'arg_not_closed'};
  83. $result_trees{'arg_not_closed'}{'contents'}[3]{'contents'}[0]{'parent'} = $result_trees{'arg_not_closed'}{'contents'}[3];
  84. $result_trees{'arg_not_closed'}{'contents'}[3]{'parent'} = $result_trees{'arg_not_closed'};
  85. $result_texis{'arg_not_closed'} = '@macro foo {arg}
  86. foo
  87. @end macro
  88. call foo
  89. ';
  90. $result_texts{'arg_not_closed'} = '
  91. call foo
  92. ';
  93. $result_errors{'arg_not_closed'} = [
  94. {
  95. 'error_line' => ':5: @foo missing closing brace
  96. ',
  97. 'file_name' => '',
  98. 'line_nr' => 5,
  99. 'macro' => '',
  100. 'text' => '@foo missing closing brace',
  101. 'type' => 'error'
  102. }
  103. ];
  104. 1;