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)
downloadefl-a4485484f1169549f51137bfa69b72a3b861d021.tar.gz
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:
}
static void
-read_doc(Eo_Lexer *ls, Eo_Token *tok)
+read_doc(Eo_Lexer *ls, Eo_Token *tok, int line, int column)
{
- Eo_Doc *doc = calloc(1, sizeof(Eo_Doc));
+ Eolian_Documentation *doc = calloc(1, sizeof(Eolian_Documentation));
+ doc->base.file = ls->filename;
+ doc->base.line = line;
+ doc->base.column = column;
+
eina_strbuf_reset(ls->buff);
skip_ws(ls);
@@ -651,11 +655,14 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
continue;
}
case '[':
- next_char(ls);
- if (ls->current != '[') return '[';
- next_char(ls);
- read_doc(ls, tok);
- return TOK_DOC;
+ {
+ int dline = ls->line_number, dcol = ls->column;
+ next_char(ls);
+ if (ls->current != '[') return '[';
+ next_char(ls);
+ read_doc(ls, tok, dline, dcol);
+ return TOK_DOC;
+ }
case '\0':
return -1;
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
NUM_DOUBLE
};
-typedef struct _Eo_Doc
-{
- Eina_Stringshare *summary;
- Eina_Stringshare *description;
-} Eo_Doc;
-
typedef union
{
char c;
@@ -99,7 +93,7 @@ typedef union
unsigned long long ull;
float f;
double d;
- Eo_Doc *doc;
+ Eolian_Documentation *doc;
} Eo_Token_Union;
/* 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
int column;
} Eolian_Object;
+typedef struct _Eolian_Documentation
+{
+ Eolian_Object base;
+ Eina_Stringshare *summary;
+ Eina_Stringshare *description;
+} Eolian_Documentation;
+
typedef struct _Eolian_Declaration
{
Eolian_Declaration_Type type;