> +#define CMP_MARK_NOTE(doc, note) !strncmp(doc, note ": ", sizeof(note) + 1)

this could be cleaner by using strlen(note ": "), or sizeof(note  ":
") - 1... at first read I thought it was a mistake :-D


> +
> +   /* different types of notes */
> +   if (CMP_MARK_NOTE(doc, "Note"))
> +     {
> +        ret->text = doc;
> +        ret->text_end = doc + sizeof("Note:");
> +        ret->type = EOLIAN_DOC_TOKEN_MARK_NOTE;
> +        return ret->text_end;
> +     }
> +   else if (CMP_MARK_NOTE(doc, "Warning"))
> +     {
> +        ret->text = doc;
> +        ret->text_end = doc + sizeof("Warning:");
> +        ret->type = EOLIAN_DOC_TOKEN_MARK_WARNING;
> +        return ret->text_end;
> +     }
> +   else if (CMP_MARK_NOTE(doc, "Remark"))
> +     {
> +        ret->text = doc;
> +        ret->text_end = doc + sizeof("Remark:");
> +        ret->type = EOLIAN_DOC_TOKEN_MARK_REMARK;
> +        return ret->text_end;
> +     }
> +   else if (CMP_MARK_NOTE(doc, "TODO"))
> +     {
> +        ret->text = doc;
> +        ret->text_end = doc + sizeof("TODO:");
> +        ret->type = EOLIAN_DOC_TOKEN_MARK_TODO;
> +        return ret->text_end;
> +     }

nice! With that, in the future we can replace \@note \@warning and the
likes with that?


> +        /* escape sequences */
> +        if ((schr != doc) && (schr[-1] == '\\'))
> +          {
> +             schr += 1;
> +             continue;
> +          }

this is often not a good way to check for escapes, due escape-of-escape:

 \\@

will be handled as a escape, while it isn't. Just replace with a
straight for() and once '\' was found, flag "escape mode" and unescape
the next char.


As for "@[x]", do you intend to use that for events? I was thinking
some other symbol could be used, like:

   @a.b, @.b => methods and classes
   @a>e => events

it's simple and allows clear distinction from methods, in the case we
have method and event with the same name, ie: Efl.Io.Reader.eos
(property) and eos (event):

   @Efl.Io.Reader.eos
   @Efl.Io.Reader>eos

It could be another symbol, like:

   @Efl.Io.Reader:eos
   @Efl.Io.Reader|eos
   @Efl.Io.Reader$eos
   @Efl.Io.Reader#eos
   @Efl.Io.Reader^eos


-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890

------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to