summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eo_definitions.h6
-rw-r--r--eo_tokenizer.rl23
2 files changed, 24 insertions, 5 deletions
diff --git a/eo_definitions.h b/eo_definitions.h
index 209cf7e..16f2f9c 100644
--- a/eo_definitions.h
+++ b/eo_definitions.h
@@ -15,9 +15,9 @@ typedef struct _eo_ret_def
typedef enum _param_way
{
- IN,
- OUT,
- INOUT,
+ PARAM_IN,
+ PARAM_OUT,
+ PARAM_INOUT,
PARAM_WAY_LAST
} Param_Way;
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl
index 9c94e46..1bc1d6c 100644
--- a/eo_tokenizer.rl
+++ b/eo_tokenizer.rl
@@ -117,9 +117,28 @@ _eo_tokenizer_param_get(Eo_Tokenizer *toknz, char *p)
if (s == toknz->saved.tok)
ABORT(toknz, "wrong parameter: %s", _eo_tokenizer_token_get(toknz, p));
+ s++;
- param->type = _eo_tokenizer_token_get(toknz, s+1);
- toknz->saved.tok = (s + 1);
+ param->way = PARAM_IN;
+ if (strncmp(toknz->saved.tok, "in ", 3) == 0)
+ {
+ toknz->saved.tok += 3;
+ param->way = PARAM_IN;
+ }
+ else if (strncmp(toknz->saved.tok, "out ", 4) == 0)
+ {
+ toknz->saved.tok += 4;
+ param->way = PARAM_OUT;
+ }
+ else if (strncmp(toknz->saved.tok, "inout ", 6) == 0)
+ {
+ toknz->saved.tok += 6;
+ param->way = PARAM_INOUT;
+ }
+
+ param->type = _eo_tokenizer_token_get(toknz, s);
+
+ toknz->saved.tok = s;
param->name = _eo_tokenizer_token_get(toknz, p);
return param;