syntax: reset status and hints when we reset token
re-use elm_code methods when we do this in edi
This commit is contained in:
parent
462a60d85d
commit
9cfe41ee00
|
@ -28,6 +28,17 @@ EAPI void elm_code_line_status_set(Elm_Code_Line *line, Elm_Code_Status_Type sta
|
|||
line->status = status;
|
||||
}
|
||||
|
||||
EAPI void elm_code_line_status_text_set(Elm_Code_Line *line, const char *text)
|
||||
{
|
||||
if (line->status_text)
|
||||
free(line->status_text);
|
||||
|
||||
if (text)
|
||||
line->status_text = strdup(text);
|
||||
else
|
||||
line->status_text = NULL;
|
||||
}
|
||||
|
||||
EAPI void elm_code_line_token_add(Elm_Code_Line *line, int start, int end, int lines,
|
||||
Elm_Code_Token_Type type)
|
||||
{
|
||||
|
@ -67,3 +78,13 @@ EAPI void elm_code_line_tokens_clear(Elm_Code_Line *line)
|
|||
line->tokens = NULL;
|
||||
}
|
||||
|
||||
EAPI void elm_code_line_status_clear(Elm_Code_Line *line)
|
||||
{
|
||||
line->status = ELM_CODE_STATUS_TYPE_DEFAULT;
|
||||
if (line->status_text)
|
||||
{
|
||||
free((char *)line->status_text);
|
||||
line->status_text = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ typedef struct _Elm_Code_Line
|
|||
Eina_List *tokens;
|
||||
|
||||
void *data;
|
||||
const char *status_text;
|
||||
char *status_text;
|
||||
} Elm_Code_Line;
|
||||
|
||||
EAPI void elm_code_line_free(Elm_Code_Line *line);
|
||||
|
@ -49,6 +49,10 @@ EAPI void elm_code_line_free(Elm_Code_Line *line);
|
|||
|
||||
EAPI void elm_code_line_status_set(Elm_Code_Line *line, Elm_Code_Status_Type status);
|
||||
|
||||
EAPI void elm_code_line_status_text_set(Elm_Code_Line *line, const char *text);
|
||||
|
||||
EAPI void elm_code_line_status_clear(Elm_Code_Line *line);
|
||||
|
||||
EAPI void elm_code_line_token_add(Elm_Code_Line *line, int start, int end, int lines, Elm_Code_Token_Type type);
|
||||
|
||||
EAPI void elm_code_line_tokens_clear(Elm_Code_Line *line);
|
||||
|
|
|
@ -23,6 +23,7 @@ _elm_code_parse_line(Elm_Code *code, Elm_Code_Line *line)
|
|||
Eina_List *item;
|
||||
|
||||
elm_code_line_tokens_clear(line);
|
||||
elm_code_line_status_clear(line);
|
||||
|
||||
EINA_LIST_FOREACH(code->parsers, item, parser)
|
||||
{
|
||||
|
@ -41,6 +42,7 @@ _elm_code_parse_file(Elm_Code *code, Elm_Code_File *file)
|
|||
EINA_LIST_FOREACH(file->lines, item, line)
|
||||
{
|
||||
elm_code_line_tokens_clear(line);
|
||||
elm_code_line_status_clear(line);
|
||||
}
|
||||
|
||||
EINA_LIST_FOREACH(code->parsers, item, parser)
|
||||
|
|
Loading…
Reference in New Issue