eolian: Eolian_Object for docs

This commit is contained in:
Daniel Kolesa 2015-06-02 18:27:46 +01:00
parent 0703cc0f5e
commit a4485484f1
3 changed files with 22 additions and 14 deletions

View File

@ -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 '=':

View File

@ -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

View File

@ -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;