eolian: parser support for constructor qualifier
authorDaniel Kolesa <d.kolesa@samsung.com>
Thu, 24 Jul 2014 12:01:47 +0000 (13:01 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Thu, 24 Jul 2014 12:01:47 +0000 (13:01 +0100)
This will be needed when the constructors {} section goes away.

src/lib/eolian/eo_lexer.h
src/lib/eolian/eo_parser.c

index 3d14821..e513592 100644 (file)
@@ -25,8 +25,9 @@ enum Tokens
     KW(destructor), KW(eo_prefix), KW(events), KW(func), KW(get), \
     KW(implements), KW(interface), KW(keys), KW(legacy), KW(legacy_prefix), \
     KW(methods), KW(mixin), KW(own), KW(params), KW(properties), KW(set), \
-    KW(type), KW(values), KWAT(class), KWAT(const), KWAT(extern), KWAT(in), \
-    KWAT(inout), KWAT(nonull), KWAT(out), KWAT(protected), KWAT(warn_unused), \
+    KW(type), KW(values), KWAT(class), KWAT(const), KWAT(constructor), \
+    KWAT(extern), KWAT(in), KWAT(inout), KWAT(nonull), KWAT(out), \
+    KWAT(protected), KWAT(warn_unused), \
     \
     KW(byte), KW(ubyte), KW(char), KW(short), KW(ushort), KW(int), KW(uint), \
     KW(long), KW(ulong), KW(llong), KW(ullong), \
index 1d46855..42de755 100644 (file)
@@ -783,7 +783,8 @@ parse_method(Eo_Lexer *ls, Eina_Bool ctor)
    Eo_Method_Def *meth = NULL;
    Eina_Bool has_const       = EINA_FALSE, has_params = EINA_FALSE,
              has_return      = EINA_FALSE, has_legacy = EINA_FALSE,
-             has_protected   = EINA_FALSE, has_class  = EINA_FALSE;
+             has_protected   = EINA_FALSE, has_class  = EINA_FALSE,
+             has_constructor = EINA_FALSE;
    meth = calloc(1, sizeof(Eo_Method_Def));
    ls->tmp.meth = meth;
    if (ctor)
@@ -823,6 +824,12 @@ parse_method(Eo_Lexer *ls, Eina_Bool ctor)
            case KW_at_class:
              CASE_LOCK(ls, class, "class qualifier");
              meth->is_class = EINA_TRUE;
+             eo_lexer_get(ls);
+             break;
+           case KW_at_constructor:
+             CASE_LOCK(ls, constructor, "constructor qualifier");
+             eo_lexer_get(ls);
+             break;
            default:
              goto body;
           }