HumanReadableLogsRules.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /* eslint-disable no-useless-escape */
  2. const rules = [
  3. {
  4. ruleId: 'hint_misplaced_alignment_tab_character',
  5. regexToMatch: /Misplaced alignment tab character \&/,
  6. },
  7. {
  8. ruleId: 'hint_extra_alignment_tab_has_been_changed',
  9. regexToMatch: /Extra alignment tab has been changed to \\cr/,
  10. },
  11. {
  12. ruleId: 'hint_display_math_should_end_with',
  13. regexToMatch: /Display math should end with \$\$/,
  14. },
  15. {
  16. ruleId: 'hint_missing_inserted',
  17. regexToMatch: /Missing [{$] inserted./,
  18. },
  19. {
  20. ruleId: 'hint_reference_undefined',
  21. regexToMatch: /Reference.+undefined/,
  22. },
  23. {
  24. ruleId: 'hint_there_were_undefined_references',
  25. regexToMatch: /There were undefined references/,
  26. },
  27. {
  28. ruleId: 'hint_citation_on_page_undefined_on_input_line',
  29. regexToMatch: /Citation .+ on page .+ undefined on input line .+/,
  30. },
  31. {
  32. ruleId: 'hint_label_multiply_defined_labels',
  33. regexToMatch: /(Label .+)? multiply[ -]defined( labels)?/,
  34. },
  35. {
  36. ruleId: 'hint_float_specifier_changed',
  37. regexToMatch: /`!?h' float specifier changed to `!?ht'/,
  38. },
  39. {
  40. ruleId: 'hint_no_positions_in_optional_float_specifier',
  41. regexToMatch: /No positions in optional float specifier/,
  42. },
  43. {
  44. ruleId: 'hint_undefined_control_sequence',
  45. regexToMatch: /Undefined control sequence/,
  46. },
  47. {
  48. ruleId: 'hint_file_not_found',
  49. regexToMatch: /File .+ not found/,
  50. },
  51. {
  52. ruleId: 'hint_unknown_graphics_extension',
  53. regexToMatch: /LaTeX Error: Unknown graphics extension: \..+/,
  54. },
  55. {
  56. ruleId: 'hint_unknown_float_option_h',
  57. regexToMatch: /LaTeX Error: Unknown float option `H'/,
  58. },
  59. {
  60. ruleId: 'hint_unknown_float_option_q',
  61. regexToMatch: /LaTeX Error: Unknown float option `q'/,
  62. },
  63. {
  64. ruleId: 'hint_math_allowed_only_in_math_mode',
  65. regexToMatch: /LaTeX Error: \\math.+ allowed only in math mode/,
  66. },
  67. {
  68. ruleId: 'hint_mismatched_environment',
  69. types: ['environment'],
  70. regexToMatch: /Error: `([^']{2,})' expected, found `([^']{2,})'.*/,
  71. newMessage: 'Error: environment does not match \\begin{$1} ... \\end{$2}',
  72. },
  73. {
  74. ruleId: 'hint_mismatched_brackets',
  75. types: ['environment'],
  76. regexToMatch: /Error: `([^a-zA-Z0-9])' expected, found `([^a-zA-Z0-9])'.*/,
  77. newMessage: "Error: brackets do not match, found '$2' instead of '$1'",
  78. },
  79. {
  80. ruleId: 'hint_can_be_used_only_in_preamble',
  81. regexToMatch: /LaTeX Error: Can be used only in preamble/,
  82. },
  83. {
  84. ruleId: 'hint_missing_right_inserted',
  85. regexToMatch: /Missing \\right inserted/,
  86. },
  87. {
  88. ruleId: 'hint_double_superscript',
  89. regexToMatch: /Double superscript/,
  90. },
  91. {
  92. ruleId: 'hint_double_subscript',
  93. regexToMatch: /Double subscript/,
  94. },
  95. {
  96. ruleId: 'hint_no_author_given',
  97. regexToMatch: /No \\author given/,
  98. },
  99. {
  100. ruleId: 'hint_environment_undefined',
  101. regexToMatch: /LaTeX Error: Environment .+ undefined/,
  102. },
  103. {
  104. ruleId: 'hint_somethings_wrong_perhaps_a_missing_item',
  105. regexToMatch: /LaTeX Error: Something's wrong--perhaps a missing \\item/,
  106. },
  107. {
  108. ruleId: 'hint_misplaced_noalign',
  109. regexToMatch: /Misplaced \\noalign/,
  110. },
  111. {
  112. ruleId: 'hint_no_line_here_to_end',
  113. regexToMatch: /LaTeX Error: There's no line here to end/,
  114. },
  115. {
  116. ruleId: 'hint_verb_ended_by_end_of_line',
  117. regexToMatch: /LaTeX Error: \\verb ended by end of line/,
  118. },
  119. {
  120. ruleId: 'hint_illegal_unit_of_measure_pt_inserted',
  121. regexToMatch: /Illegal unit of measure (pt inserted)/,
  122. },
  123. {
  124. ruleId: 'hint_extra_right',
  125. regexToMatch: /Extra \\right/,
  126. },
  127. {
  128. ruleId: 'hint_missing_begin_document_',
  129. regexToMatch: /Missing \\begin{document}/,
  130. },
  131. {
  132. ruleId: 'hint_mismatched_environment2',
  133. types: ['environment'],
  134. cascadesFrom: ['environment'],
  135. regexToMatch:
  136. /Error: `\\end\{([^\}]+)\}' expected but found `\\end\{([^\}]+)\}'.*/,
  137. newMessage: 'Error: environments do not match: \\begin{$1} ... \\end{$2}',
  138. },
  139. {
  140. ruleId: 'hint_mismatched_environment3',
  141. types: ['environment'],
  142. cascadesFrom: ['environment'],
  143. regexToMatch:
  144. /Warning: No matching \\end found for `\\begin\{([^\}]+)\}'.*/,
  145. newMessage: 'Warning: No matching \\end found for \\begin{$1}',
  146. },
  147. {
  148. ruleId: 'hint_mismatched_environment4',
  149. types: ['environment'],
  150. cascadesFrom: ['environment'],
  151. regexToMatch:
  152. /Error: Found `\\end\{([^\}]+)\}' without corresponding \\begin.*/,
  153. newMessage: 'Error: found \\end{$1} without a corresponding \\begin{$1}',
  154. },
  155. ]
  156. export default rules