summaryrefslogtreecommitdiff
path: root/src/lib/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-21 16:01:07 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-21 16:04:35 +0200
commit5ea0195661e88395ee3e7384db7acc3f03d52dc1 (patch)
tree395a85fe0bd2147a9d22311162fc5cd2d22384fd /src/lib/eolian
parent34ef9c313989402d523951b2c20c7141d3bdce78 (diff)
eolian: remove @nullable keyword
This was an experiment that never properly took off and was never used by any generator. Its use was highly variable, so it could not be relied upon. We will still want to reverse the current behavior eventually (no null by default), but that will be done with eo file versioning in the future. @feature
Diffstat (limited to 'src/lib/eolian')
-rw-r--r--src/lib/eolian/Eolian.h10
-rw-r--r--src/lib/eolian/database_function_parameter_api.c7
-rw-r--r--src/lib/eolian/eo_lexer.h5
-rw-r--r--src/lib/eolian/eo_parser.c11
-rw-r--r--src/lib/eolian/eolian_database.h1
5 files changed, 5 insertions, 29 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 3715ed1..2f5346e 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -1792,16 +1792,6 @@ EAPI const Eolian_Documentation *eolian_parameter_documentation_get(const Eolian
1792EAPI Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc); 1792EAPI Eina_Bool eolian_parameter_is_nonull(const Eolian_Function_Parameter *param_desc);
1793 1793
1794/* 1794/*
1795 * @brief Indicates if a parameter is nullable.
1796 *
1797 * @param[in] param_desc parameter handle
1798 * @return EINA_TRUE if nullable, EINA_FALSE otherwise
1799 *
1800 * @ingroup Eolian
1801 */
1802EAPI Eina_Bool eolian_parameter_is_nullable(const Eolian_Function_Parameter *param_desc);
1803
1804/*
1805 * @brief Indicates if a parameter is optional. 1795 * @brief Indicates if a parameter is optional.
1806 * 1796 *
1807 * @param[in] param_desc parameter handle 1797 * @param[in] param_desc parameter handle
diff --git a/src/lib/eolian/database_function_parameter_api.c b/src/lib/eolian/database_function_parameter_api.c
index 87f1ed3..265c98e 100644
--- a/src/lib/eolian/database_function_parameter_api.c
+++ b/src/lib/eolian/database_function_parameter_api.c
@@ -41,13 +41,6 @@ eolian_parameter_is_nonull(const Eolian_Function_Parameter *param)
41} 41}
42 42
43EAPI Eina_Bool 43EAPI Eina_Bool
44eolian_parameter_is_nullable(const Eolian_Function_Parameter *param)
45{
46 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
47 return param->nullable;
48}
49
50EAPI Eina_Bool
51eolian_parameter_is_optional(const Eolian_Function_Parameter *param) 44eolian_parameter_is_optional(const Eolian_Function_Parameter *param)
52{ 45{
53 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE); 46 EINA_SAFETY_ON_NULL_RETURN_VAL(param, EINA_FALSE);
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 4fec039..cc8fc9c 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -21,7 +21,10 @@ enum Tokens
21}; 21};
22 22
23/* all keywords in eolian, they can still be used as names (they're TOK_VALUE) 23/* all keywords in eolian, they can still be used as names (they're TOK_VALUE)
24 * they just fill in the "kw" field of the token */ 24 * they just fill in the "kw" field of the token
25 *
26 * reserved for the future: @nullable
27 */
25#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \ 28#define KEYWORDS KW(class), KW(const), KW(enum), KW(return), KW(struct), \
26 \ 29 \
27 KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \ 30 KW(abstract), KW(c_prefix), KW(composite), KW(constructor), KW(constructors), \
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index 80d89e5..3a75555 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -907,7 +907,7 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
907 Eina_Bool is_vals) 907 Eina_Bool is_vals)
908{ 908{
909 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE, 909 Eina_Bool has_nonull = EINA_FALSE, has_optional = EINA_FALSE,
910 has_nullable = EINA_FALSE, has_owned = EINA_FALSE; 910 has_owned = EINA_FALSE;
911 Eina_Bool cref = (ls->t.kw == KW_at_cref); 911 Eina_Bool cref = (ls->t.kw == KW_at_cref);
912 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter)); 912 Eolian_Function_Parameter *par = calloc(1, sizeof(Eolian_Function_Parameter));
913 par->param_dir = EOLIAN_IN_PARAM; 913 par->param_dir = EOLIAN_IN_PARAM;
@@ -956,8 +956,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
956 for (;;) switch (ls->t.kw) 956 for (;;) switch (ls->t.kw)
957 { 957 {
958 case KW_at_nonull: 958 case KW_at_nonull:
959 if (has_nullable)
960 eo_lexer_syntax_error(ls, "both nullable and nonull specified");
961 CASE_LOCK(ls, nonull, "nonull qualifier") 959 CASE_LOCK(ls, nonull, "nonull qualifier")
962 par->nonull = EINA_TRUE; 960 par->nonull = EINA_TRUE;
963 eo_lexer_get(ls); 961 eo_lexer_get(ls);
@@ -967,13 +965,6 @@ parse_param(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout,
967 par->optional = EINA_TRUE; 965 par->optional = EINA_TRUE;
968 eo_lexer_get(ls); 966 eo_lexer_get(ls);
969 break; 967 break;
970 case KW_at_nullable:
971 if (has_nonull)
972 eo_lexer_syntax_error(ls, "both nullable and nonull specified");
973 CASE_LOCK(ls, nullable, "nullable qualifier");
974 par->nullable = EINA_TRUE;
975 eo_lexer_get(ls);
976 break;
977 case KW_at_owned: 968 case KW_at_owned:
978 CASE_LOCK(ls, owned, "owned qualifier"); 969 CASE_LOCK(ls, owned, "owned qualifier");
979 par->type->owned = EINA_TRUE; 970 par->type->owned = EINA_TRUE;
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index f2dceba..f51f426 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -252,7 +252,6 @@ struct _Eolian_Function_Parameter
252 Eolian_Documentation *doc; 252 Eolian_Documentation *doc;
253 Eolian_Parameter_Dir param_dir; 253 Eolian_Parameter_Dir param_dir;
254 Eina_Bool nonull :1; /* True if this argument cannot be NULL - deprecated */ 254 Eina_Bool nonull :1; /* True if this argument cannot be NULL - deprecated */
255 Eina_Bool nullable :1; /* True if this argument is nullable */
256 Eina_Bool optional :1; /* True if this argument is optional */ 255 Eina_Bool optional :1; /* True if this argument is optional */
257}; 256};
258 257