You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a new option to IParseOptions, alternateCommentMode. When enabled, this activates an alternate comment parsing mode that preserves double-slash comments.
test.equal(root.lookup("Test3").comment,"Message\nwith\na\ncomment and stars.","should parse doc-block multiline comment");
16
+
17
+
test.equal(root.lookup("Test1.field1").comment,"Field with a doc-block comment.","should parse doc-block field comment");
18
+
test.equal(root.lookup("Test1.field2").comment,"Field with a single-line comment starting with two slashes.","should parse double-slash field comment");
19
+
test.equal(root.lookup("Test1.field3").comment,"Field with a single-line comment starting with three slashes.","should parse triple-slash field comment");
20
+
test.equal(root.lookup("Test1.field4").comment,"Field with a single-line slash-star comment.","should parse single-line slash-star field comment");
21
+
test.equal(root.lookup("Test1.field5").comment,"Field with a trailing single-line two-slash comment.","should parse trailing double-slash comment");
22
+
test.equal(root.lookup("Test1.field6").comment,"Field with a trailing single-line three-slash comment.","should parse trailing triple-slash comment");
23
+
test.equal(root.lookup("Test1.field7").comment,"Field with a trailing single-line slash-star comment.","should parse trailing slash-star comment");
24
+
test.equal(root.lookup("Test1.field8").comment,null,"should parse no comment");
25
+
test.equal(root.lookup("Test1.field9").comment,"Field with a\nmulti-line comment.","should parse multiline double-slash field comment");
26
+
test.equal(root.lookup("Test1.field10").comment,"Field with a\nmulti-line doc-block comment.","should parse multiline doc-block field comment");
27
+
28
+
test.equal(root.lookup("Test3").comments.ONE,"Value with a comment.","should parse blocks for enum values");
29
+
test.equal(root.lookup("Test3").comments.TWO,"Value with a single-line comment.","should parse double-slash comments for enum values");
30
+
test.equal(root.lookup("Test3").comments.THREE,"Value with a triple-slash comment.","should parse lines for enum values and prefer on top over trailing");
31
+
test.equal(root.lookup("Test3").comments.FOUR,"Other value with a comment.","should not confuse previous trailing comments with comments for the next field");
0 commit comments