summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eo_lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eolian/eo_lexer.c')
-rw-r--r--src/lib/eolian/eo_lexer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index 6b2747a130..aad79d8f71 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -45,6 +45,7 @@ next_char(Eo_Lexer *ls)
45 45
46#define KW(x) #x 46#define KW(x) #x
47#define KWAT(x) "@" #x 47#define KWAT(x) "@" #x
48#define KWH(x) "#" #x
48 49
49static const char * const tokens[] = 50static const char * const tokens[] =
50{ 51{
@@ -87,6 +88,7 @@ static const char * const ctypes[] =
87 88
88#undef KW 89#undef KW
89#undef KWAT 90#undef KWAT
91#undef KWH
90 92
91#define is_newline(c) ((c) == '\n' || (c) == '\r') 93#define is_newline(c) ((c) == '\n' || (c) == '\r')
92 94
@@ -989,10 +991,10 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
989 return TOK_NUMBER; 991 return TOK_NUMBER;
990 } 992 }
991 if (ls->current && (isalnum(ls->current) 993 if (ls->current && (isalnum(ls->current)
992 || ls->current == '@' || ls->current == '_')) 994 || ls->current == '@' || ls->current == '#' || ls->current == '_'))
993 { 995 {
994 int col = ls->column; 996 int col = ls->column;
995 Eina_Bool at_kw = (ls->current == '@'); 997 Eina_Bool pfx_kw = (ls->current == '@') || (ls->current == '#');
996 const char *str; 998 const char *str;
997 eina_strbuf_reset(ls->buff); 999 eina_strbuf_reset(ls->buff);
998 do 1000 do
@@ -1007,7 +1009,7 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
1007 str); 1009 str);
1008 ls->column = col + 1; 1010 ls->column = col + 1;
1009 tok->value.s = eina_stringshare_add(str); 1011 tok->value.s = eina_stringshare_add(str);
1010 if (at_kw && tok->kw == 0) 1012 if (pfx_kw && tok->kw == 0)
1011 eo_lexer_syntax_error(ls, "invalid keyword"); 1013 eo_lexer_syntax_error(ls, "invalid keyword");
1012 return TOK_VALUE; 1014 return TOK_VALUE;
1013 } 1015 }