@@ -140,6 +140,7 @@ module Ast_to_sexp = struct
140
140
| `Inline -> Atom "@inline"
141
141
| `Open -> Atom "@open"
142
142
| `Closed -> Atom "@closed"
143
+ | `Hidden -> Atom "@hidden"
143
144
144
145
let block_element at : Ast.block_element -> sexp = function
145
146
| #Ast.nestable_block_element as e -> nestable_block_element at e
@@ -4640,6 +4641,78 @@ let%expect_test _ =
4640
4641
end in
4641
4642
()
4642
4643
4644
+ let%expect_test _ =
4645
+ let module Hidden = struct
4646
+ let basic =
4647
+ test "@hidden";
4648
+ [%expect {| ((output (((f.ml (1 0) (1 7)) @hidden))) (warnings ())) |}]
4649
+
4650
+ let prefix =
4651
+ test "@hiddenfoo";
4652
+ [%expect
4653
+ {|
4654
+ ((output
4655
+ (((f.ml (1 0) (1 10))
4656
+ (paragraph (((f.ml (1 0) (1 10)) (word @hiddenfoo)))))))
4657
+ (warnings
4658
+ ( "File \"f.ml\", line 1, characters 0-10:\
4659
+ \nUnknown tag '@hiddenfoo'."))) |}]
4660
+
4661
+ let extra_whitespace =
4662
+ test "@hidden";
4663
+ [%expect {| ((output (((f.ml (1 0) (1 7)) @hidden))) (warnings ())) |}]
4664
+
4665
+ let followed_by_junk =
4666
+ test "@hidden foo";
4667
+ [%expect
4668
+ {|
4669
+ ((output
4670
+ (((f.ml (1 0) (1 7)) @hidden)
4671
+ ((f.ml (1 8) (1 11)) (paragraph (((f.ml (1 8) (1 11)) (word foo)))))))
4672
+ (warnings
4673
+ ( "File \"f.ml\", line 1, characters 8-11:\
4674
+ \nParagraph is not allowed in the tags section.\
4675
+ \nSuggestion: move 'foo' before any tags."
4676
+ "File \"f.ml\", line 1, characters 8-11:\
4677
+ \nParagraph should begin on its own line."))) |}]
4678
+
4679
+ let followed_by_paragraph =
4680
+ test "@hidden\nfoo";
4681
+ [%expect
4682
+ {|
4683
+ ((output
4684
+ (((f.ml (1 0) (1 7)) @hidden)
4685
+ ((f.ml (2 0) (2 3)) (paragraph (((f.ml (2 0) (2 3)) (word foo)))))))
4686
+ (warnings
4687
+ ( "File \"f.ml\", line 2, characters 0-3:\
4688
+ \nParagraph is not allowed in the tags section.\
4689
+ \nSuggestion: move 'foo' before any tags."))) |}]
4690
+
4691
+ let followed_by_tag =
4692
+ test "@hidden\n@deprecated";
4693
+ [%expect
4694
+ {|
4695
+ ((output (((f.ml (1 0) (1 7)) @hidden) ((f.ml (2 0) (2 11)) (@deprecated))))
4696
+ (warnings ())) |}]
4697
+
4698
+ let with_list =
4699
+ test "@hidden - foo";
4700
+ [%expect
4701
+ {|
4702
+ ((output
4703
+ (((f.ml (1 0) (1 7)) @hidden)
4704
+ ((f.ml (1 8) (1 13))
4705
+ (unordered light
4706
+ ((((f.ml (1 10) (1 13)) (paragraph (((f.ml (1 10) (1 13)) (word foo)))))))))))
4707
+ (warnings
4708
+ ( "File \"f.ml\", line 1, characters 8-9:\
4709
+ \n'-' (bulleted list item) should begin on its own line."
4710
+ "File \"f.ml\", line 1, characters 8-9:\
4711
+ \n'-' (bulleted list item) is not allowed in the tags section.\
4712
+ \nSuggestion: move '-' (bulleted list item) before any tags."))) |}]
4713
+ end in
4714
+ ()
4715
+
4643
4716
let%expect_test _ =
4644
4717
let module Bad_markup = struct
4645
4718
let left_brace =
0 commit comments