1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
|
Various tests for the 'compile' command.
'ast.mli' is a collection of different syntaxes.
$ ocamlc -bin-annot -c ast.mli
$ odoc compile --package foo ast.cmti
File "ast.mli", line 1, characters 4-17:
Warning: Unknown tag '@TxtAttribute'.
File "ast.mli", line 4, characters 4-21:
Warning: Unknown tag '@ValueDeclaration'.
File "ast.mli", line 6, characters 4-21:
Warning: Unknown tag '@ValueDeclaration'.
File "ast.mli", line 8, characters 4-21:
Warning: Unknown tag '@ValueDeclaration'.
File "ast.mli", line 11, characters 4-20:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 13, characters 4-20:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 14, characters 16-39:
Warning: Unknown tag '@ConstructorDeclaration'.
File "ast.mli", line 15, characters 16-39:
Warning: Unknown tag '@ConstructorDeclaration'.
File "ast.mli", line 22, characters 4-20:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 24, characters 15-32:
Warning: Unknown tag '@LabelDeclaration'.
File "ast.mli", line 25, characters 16-33:
Warning: Unknown tag '@LabelDeclaration'.
File "ast.mli", line 29, characters 4-20:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 31, characters 4-18:
Warning: Unknown tag '@TypeExtension'.
File "ast.mli", line 32, characters 17-27:
Warning: Unknown tag '@Extension'.
File "ast.mli", line 33, characters 17-27:
Warning: Unknown tag '@Extension'.
File "ast.mli", line 35, characters 4-26:
Warning: Unknown tag '@ModuleTypeDeclaration'.
File "ast.mli", line 37, characters 6-19:
Warning: Unknown tag '@TxtAttribute'.
File "ast.mli", line 40, characters 6-22:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 43, characters 4-22:
Warning: Unknown tag '@ModuleDeclaration'.
File "ast.mli", line 45, characters 6-19:
Warning: Unknown tag '@TxtAttribute'.
File "ast.mli", line 47, characters 6-24:
Warning: Unknown tag '@ModuleDeclaration'.
File "ast.mli", line 49, characters 8-21:
Warning: Unknown tag '@TxtAttribute'.
File "ast.mli", line 52, characters 8-24:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 57, characters 4-14:
Warning: Unknown tag '@Exception'.
File "ast.mli", line 60, characters 4-11:
Warning: Unknown tag '@Hidden'.
File "ast.mli", line 63, characters 4-23:
Warning: Unknown tag '@IncludeDescription'.
File "ast.mli", line 68, characters 6-22:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 65, characters 6-19:
Warning: Unknown tag '@TxtAttribute'.
File "ast.mli", line 68, characters 6-22:
Warning: Unknown tag '@TypeDeclaration'.
File "ast.mli", line 71, characters 4-10:
Warning: Unknown tag '@Class'.
File "ast.mli", line 74, characters 6-13:
Warning: Unknown tag '@Method'.
Test different parsing errors.
$ ocamlc -bin-annot -c parser_errors.mli
$ odoc compile --package foo parser_errors.cmti
File "parser_errors.mli", line 1, characters 4-26:
Warning: '{x This is bad markup}': bad markup.
Suggestion: did you mean '{!x This is bad markup}' or '[x This is bad markup]'?
File "parser_errors.mli", line 4, characters 4-24:
Warning: '9': bad heading level (0-5 allowed).
File "parser_errors.mli", line 10, characters 8-11:
Warning: '{li ...}' should be followed by space, a tab, or a new line.
File "parser_errors.mli", line 13, characters 4-7:
Warning: '{li ...}' (list item) is not allowed in top-level text.
Suggestion: move '{li ...}' into '{ul ...}' (bulleted list), or use '-' (bulleted list item).
File "parser_errors.mli", line 13, characters 19-20:
Warning: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 16, characters 4-6:
Warning: '{v' should be followed by whitespace.
File "parser_errors.mli", line 19, characters 37-39:
Warning: 'v}' should be preceded by whitespace.
File "parser_errors.mli", line 22, characters 4-5:
Warning: Stray '@'.
File "parser_errors.mli", line 28, characters 4-11:
Warning: '@before' expects version number on the same line.
File "parser_errors.mli", line 31, characters 4-10:
Warning: '@param' expects parameter name on the same line.
File "parser_errors.mli", line 34, characters 4-10:
Warning: '@raise' expects exception constructor on the same line.
File "parser_errors.mli", line 37, characters 4-11:
Warning: '@raises' expects exception constructor on the same line.
File "parser_errors.mli", line 40, characters 4-8:
Warning: '@see' should be followed by <url>, 'file', or "document title".
File "parser_errors.mli", line 43, characters 4-15:
Warning: Unknown tag '@UnknownTag'.
File "parser_errors.mli", line 46, characters 4-5:
Warning: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 49, characters 4-5:
Warning: Unpaired ']' (end of code).
Suggestion: try '\]'.
File "parser_errors.mli", line 53, characters 4-5:
Warning: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 56, characters 4-18:
Warning: '{x bad markup}': bad markup.
Suggestion: did you mean '{!x bad markup}' or '[x bad markup]'?
With warn-error enabled.
$ odoc compile --package foo --warn-error parser_errors.cmti
File "parser_errors.mli", line 1, characters 4-26:
Error: '{x This is bad markup}': bad markup.
Suggestion: did you mean '{!x This is bad markup}' or '[x This is bad markup]'?
File "parser_errors.mli", line 4, characters 4-24:
Error: '9': bad heading level (0-5 allowed).
File "parser_errors.mli", line 10, characters 8-11:
Error: '{li ...}' should be followed by space, a tab, or a new line.
File "parser_errors.mli", line 13, characters 4-7:
Error: '{li ...}' (list item) is not allowed in top-level text.
Suggestion: move '{li ...}' into '{ul ...}' (bulleted list), or use '-' (bulleted list item).
File "parser_errors.mli", line 13, characters 19-20:
Error: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 16, characters 4-6:
Error: '{v' should be followed by whitespace.
File "parser_errors.mli", line 19, characters 37-39:
Error: 'v}' should be preceded by whitespace.
File "parser_errors.mli", line 22, characters 4-5:
Error: Stray '@'.
File "parser_errors.mli", line 28, characters 4-11:
Error: '@before' expects version number on the same line.
File "parser_errors.mli", line 31, characters 4-10:
Error: '@param' expects parameter name on the same line.
File "parser_errors.mli", line 34, characters 4-10:
Error: '@raise' expects exception constructor on the same line.
File "parser_errors.mli", line 37, characters 4-11:
Error: '@raises' expects exception constructor on the same line.
File "parser_errors.mli", line 40, characters 4-8:
Error: '@see' should be followed by <url>, 'file', or "document title".
File "parser_errors.mli", line 43, characters 4-15:
Error: Unknown tag '@UnknownTag'.
File "parser_errors.mli", line 46, characters 4-5:
Error: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 49, characters 4-5:
Error: Unpaired ']' (end of code).
Suggestion: try '\]'.
File "parser_errors.mli", line 53, characters 4-5:
Error: Unpaired '}' (end of markup).
Suggestion: try '\}'.
File "parser_errors.mli", line 56, characters 4-18:
Error: '{x bad markup}': bad markup.
Suggestion: did you mean '{!x bad markup}' or '[x bad markup]'?
ERROR: Warnings have been generated.
[1]
Compiling a '.cmt' file.
$ ocamlc -bin-annot -c impl_only.ml
$ odoc compile --package foo impl_only.cmt
Check line numbers for errors in a '.mld' file.
$ odoc compile line_numbers.mld
File "line_numbers.mld", line 2, characters 0-4:
Warning: '{[...]}' (code block) should not be empty.
File "line_numbers.mld", line 8, characters 0-12:
Warning: '{Bad Markup}': bad markup.
Suggestion: did you mean '{!Bad Markup}' or '[Bad Markup]'?
File "line_numbers.mld", line 32, characters 0-1:
Warning: '{': bad markup.
Suggestion: escape the brace with '\{'.
File "line_numbers.mld", line 16, characters 0-11:
Warning: '6': bad heading level (0-5 allowed).
|