Skip to content

Commit 7980bf5

Browse files
committed
Use NOTE instead of LABEL for TomDoc lists
1 parent 722abfd commit 7980bf5

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/rdoc/tom_doc.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def tokenize text
102102

103103
[:TEXT, 'Examples', *token_pos(pos)]
104104
when s.scan(/([:\w]\w*)[ ]+- /) then
105-
[:LABEL, s[1], *token_pos(pos)]
105+
[:NOTE, s[1], *token_pos(pos)]
106106
else
107107
s.scan(/.*/)
108108
[:TEXT, s.matched.sub(/\r$/, ''), *token_pos(pos)]

test/test_rdoc_tom_doc.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_parse_arguments
5959
@RM::Paragraph.new('Create new Arg object.'),
6060
@RM::BlankLine.new,
6161
@RM::List.new(
62-
:LABEL,
62+
:NOTE,
6363
@RM::ListItem.new(
6464
'name',
6565
@RM::Paragraph.new('name of argument')),
@@ -83,7 +83,7 @@ def test_parse_arguments_multiline
8383
@RM::Paragraph.new('Do some stuff'),
8484
@RM::BlankLine.new,
8585
@RM::List.new(
86-
:LABEL,
86+
:NOTE,
8787
@RM::ListItem.new(
8888
'foo',
8989
@RM::Paragraph.new(
@@ -105,12 +105,12 @@ def test_parse_arguments_nested
105105
@RM::Paragraph.new('Do some stuff'),
106106
@RM::BlankLine.new,
107107
@RM::List.new(
108-
:LABEL,
108+
:NOTE,
109109
@RM::ListItem.new(
110110
'foo',
111111
@RM::Paragraph.new('A comment goes here'),
112112
@RM::List.new(
113-
:LABEL,
113+
:NOTE,
114114
@RM::ListItem.new(
115115
':bar',
116116
@RM::Paragraph.new('bar documentation'))))))
@@ -194,10 +194,10 @@ def test_tokenize_arguments
194194
[:TEXT, "Create new Arg object.", 0, 0],
195195
[:NEWLINE, "\n", 22, 0],
196196
[:NEWLINE, "\n", 0, 1],
197-
[:LABEL, "name", 0, 2],
197+
[:NOTE, "name", 0, 2],
198198
[:TEXT, "name of argument", 14, 2],
199199
[:NEWLINE, "\n", 30, 2],
200-
[:LABEL, "description", 0, 3],
200+
[:NOTE, "description", 0, 3],
201201
[:TEXT, "arguments description", 14, 3],
202202
[:NEWLINE, "\n", 35, 3],
203203
]
@@ -217,7 +217,7 @@ def test_tokenize_arguments_multiline
217217
[:TEXT, "Do some stuff", 0, 0],
218218
[:NEWLINE, "\n", 13, 0],
219219
[:NEWLINE, "\n", 0, 1],
220-
[:LABEL, "foo", 0, 2],
220+
[:NOTE, "foo", 0, 2],
221221
[:TEXT, "A comment goes here", 6, 2],
222222
[:NEWLINE, "\n", 25, 2],
223223
[:TEXT, "and is more than one line", 2, 3],
@@ -239,10 +239,10 @@ def test_tokenize_arguments_nested
239239
[:TEXT, "Do some stuff", 0, 0],
240240
[:NEWLINE, "\n", 13, 0],
241241
[:NEWLINE, "\n", 0, 1],
242-
[:LABEL, "foo", 0, 2],
242+
[:NOTE, "foo", 0, 2],
243243
[:TEXT, "A comment goes here", 6, 2],
244244
[:NEWLINE, "\n", 25, 2],
245-
[:LABEL, ":bar", 6, 3],
245+
[:NOTE, ":bar", 6, 3],
246246
[:TEXT, "bar documentation", 13, 3],
247247
[:NEWLINE, "\n", 30, 3],
248248
]

0 commit comments

Comments
 (0)