summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-04 15:41:52 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-04 15:41:52 +0100
commitaf2bcfa9d1f46fc7ef99b0f5f4dc9851dcf52612 (patch)
tree23ec6168a7ca6f7e75197bfb2ff922bcfaa0831b /src
parent20934fa03da25b2923192926d9a13b8201311b2e (diff)
eolian: double newline ends summary, not single
This allows you to split the summary on multiple lines if necessary (for example to satisfy line limit) @fix
Diffstat (limited to 'src')
-rw-r--r--src/lib/eolian/eo_lexer.c12
-rw-r--r--src/tests/eolian/data/docs.eo1
-rw-r--r--src/tests/eolian/eolian_parsing.c2
3 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index 1f612f1c8f..02df2fa9d4 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -275,9 +275,15 @@ read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
275 } 275 }
276 if (is_newline(ls->current)) 276 if (is_newline(ls->current))
277 { 277 {
278 while (is_newline(ls->current)) 278 next_line_ws(ls);
279 next_line_ws(ls); 279 if (is_newline(ls->current))
280 break; 280 {
281 while (is_newline(ls->current))
282 next_line_ws(ls);
283 break;
284 }
285 else
286 eina_strbuf_append_char(ls->buff, ' ');
281 } 287 }
282 else 288 else
283 { 289 {
diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo
index c219cedbe5..eb89c929f6 100644
--- a/src/tests/eolian/data/docs.eo
+++ b/src/tests/eolian/data/docs.eo
@@ -1,5 +1,6 @@
1struct Foo { 1struct Foo {
2 [[This is struct Foo. 2 [[This is struct Foo.
3 It does stuff.
3 4
4 This is a longer description for struct Foo. 5 This is a longer description for struct Foo.
5 6
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 8b8503b086..8ffc93626e 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1150,7 +1150,7 @@ START_TEST(eolian_docs)
1150 fail_if(!(type = eolian_type_struct_get_by_name("Foo"))); 1150 fail_if(!(type = eolian_type_struct_get_by_name("Foo")));
1151 fail_if(!(doc = eolian_type_documentation_get(type))); 1151 fail_if(!(doc = eolian_type_documentation_get(type)));
1152 fail_if(strcmp(eolian_documentation_summary_get(doc), 1152 fail_if(strcmp(eolian_documentation_summary_get(doc),
1153 "This is struct Foo.")); 1153 "This is struct Foo. It does stuff."));
1154 fail_if(strcmp(eolian_documentation_description_get(doc), 1154 fail_if(strcmp(eolian_documentation_description_get(doc),
1155 "This is a longer description for struct Foo.\n\n" 1155 "This is a longer description for struct Foo.\n\n"
1156 "This is another paragraph.")); 1156 "This is another paragraph."));