summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-02 18:27:46 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2015-06-02 18:27:46 +0100
commita4485484f1169549f51137bfa69b72a3b861d021 (patch)
tree9d5ab9f6c176f50246aa7e341e5fd2522b2c7dd9
parent0703cc0f5ee76ff607a03ef5b7c452e687cef0e9 (diff)
eolian: Eolian_Object for docs
-rw-r--r--src/lib/eolian/eo_lexer.c21
-rw-r--r--src/lib/eolian/eo_lexer.h8
-rw-r--r--src/lib/eolian/eolian_database.h7
3 files changed, 22 insertions, 14 deletions
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index 0e9548f3cc..69fef679c4 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -253,9 +253,13 @@ cend:
253} 253}
254 254
255static void 255static void
256read_doc(Eo_Lexer *ls, Eo_Token *tok) 256read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
257{ 257{
258 Eo_Doc *doc = calloc(1, sizeof(Eo_Doc)); 258 Eolian_Documentation *doc = calloc(1, sizeof(Eolian_Documentation));
259 doc->base.file = ls->filename;
260 doc->base.line = line;
261 doc->base.column = column;
262
259 eina_strbuf_reset(ls->buff); 263 eina_strbuf_reset(ls->buff);
260 264
261 skip_ws(ls); 265 skip_ws(ls);
@@ -651,11 +655,14 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
651 continue; 655 continue;
652 } 656 }
653 case '[': 657 case '[':
654 next_char(ls); 658 {
655 if (ls->current != '[') return '['; 659 int dline = ls->line_number, dcol = ls->column;
656 next_char(ls); 660 next_char(ls);
657 read_doc(ls, tok); 661 if (ls->current != '[') return '[';
658 return TOK_DOC; 662 next_char(ls);
663 read_doc(ls, tok, dline, dcol);
664 return TOK_DOC;
665 }
659 case '\0': 666 case '\0':
660 return -1; 667 return -1;
661 case '=': 668 case '=':
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index f56bc0b61b..713599d1d9 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -81,12 +81,6 @@ enum Numbers
81 NUM_DOUBLE 81 NUM_DOUBLE
82}; 82};
83 83
84typedef struct _Eo_Doc
85{
86 Eina_Stringshare *summary;
87 Eina_Stringshare *description;
88} Eo_Doc;
89
90typedef union 84typedef union
91{ 85{
92 char c; 86 char c;
@@ -99,7 +93,7 @@ typedef union
99 unsigned long long ull; 93 unsigned long long ull;
100 float f; 94 float f;
101 double d; 95 double d;
102 Eo_Doc *doc; 96 Eolian_Documentation *doc;
103} Eo_Token_Union; 97} Eo_Token_Union;
104 98
105/* a token - "token" is the actual token id, "value" is the value of a token 99/* a token - "token" is the actual token id, "value" is the value of a token
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 86b0180947..f315d1ba46 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -60,6 +60,13 @@ typedef struct _Eolian_Object
60 int column; 60 int column;
61} Eolian_Object; 61} Eolian_Object;
62 62
63typedef struct _Eolian_Documentation
64{
65 Eolian_Object base;
66 Eina_Stringshare *summary;
67 Eina_Stringshare *description;
68} Eolian_Documentation;
69
63typedef struct _Eolian_Declaration 70typedef struct _Eolian_Declaration
64{ 71{
65 Eolian_Declaration_Type type; 72 Eolian_Declaration_Type type;