aboutsummaryrefslogtreecommitdiffstats
path: root/src/frontend/lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/lexer.c')
-rw-r--r--src/frontend/lexer.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/frontend/lexer.c b/src/frontend/lexer.c
index 668d7cd..a832a17 100644
--- a/src/frontend/lexer.c
+++ b/src/frontend/lexer.c
@@ -8,7 +8,7 @@
#define LEX_ERROR(x) {push_lexing_error(x,src,translation_data); return get_token(src->src+src->where_in_src,0,KW_NOP,src->current_row,src->current_column);}
/*
- * placeholder very slow lexer that I will probabbly not replace
+ * placeholder very slow ( and very very bad ) lexer that I will probabbly not replace
*/
void lex(struct Queue *token_destination,struct Source *src,struct Translation_Data *translation_data)
{
@@ -69,9 +69,11 @@ struct token* lex_step(struct Source *src,struct Translation_Data *translation_d
return get_token(src->src+src->where_in_src-sizeof("event")+1,sizeof("event")-1,KW_EVENT,src->current_row,src->current_column);
if(check_and_move_if_on_word("transitions",sizeof("transitions")-1,src,1))
return get_token(src->src+src->where_in_src-sizeof("transitions")+1,sizeof("transitions")-1,KW_TRANSITIONS,src->current_row,src->current_column);
+ if(check_and_move_if_on_word("if",sizeof("if")-1,src,1))
+ return get_token(src->src+src->where_in_src-sizeof("if")+1,sizeof("if")-1,KW_IF,src->current_row,src->current_column);
-
-
+ if(check_and_move_if_on_word("else",sizeof("else")-1,src,1))
+ return get_token(src->src+src->where_in_src-sizeof("else")+1,sizeof("else")-1,KW_ELSE,src->current_row,src->current_column);