From b845e4754be86d2216733d9bea75cb301f38739d Mon Sep 17 00:00:00 2001 From: Galin Simeonov Date: Fri, 4 Jun 2021 13:04:36 +0300 Subject: added expressions and the if statement --- src/frontend/lexer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/frontend/lexer.c') diff --git a/src/frontend/lexer.c b/src/frontend/lexer.c index de8ff95..668d7cd 100644 --- a/src/frontend/lexer.c +++ b/src/frontend/lexer.c @@ -49,10 +49,10 @@ struct token* lex_step(struct Source *src,struct Translation_Data *translation_d return get_token(src->src+src->where_in_src-sizeof("]")+1,sizeof("]")-1,KW_CLOSE_SQUARE,src->current_row,src->current_column); if(check_and_move_if_on_word(";",sizeof(";")-1,src,0)) return get_token(src->src+src->where_in_src-sizeof(";")+1,sizeof(";")-1,KW_SEMI_COLUMN,src->current_row,src->current_column); - if(check_and_move_if_on_word("|",sizeof("|")-1,src,0)) - return get_token(src->src+src->where_in_src-sizeof("|")+1,sizeof("|")-1,KW_PIPE,src->current_row,src->current_column); if(check_and_move_if_on_word("||",sizeof("||")-1,src,0)) return get_token(src->src+src->where_in_src-sizeof("||")+1,sizeof("||")-1,KW_OR,src->current_row,src->current_column); + if(check_and_move_if_on_word("|",sizeof("|")-1,src,0)) + return get_token(src->src+src->where_in_src-sizeof("|")+1,sizeof("|")-1,KW_PIPE,src->current_row,src->current_column); if(check_and_move_if_on_word("&&",sizeof("&&")-1,src,0)) return get_token(src->src+src->where_in_src-sizeof("&&")+1,sizeof("&&")-1,KW_AND,src->current_row,src->current_column); if(check_and_move_if_on_word("!",sizeof("!")-1,src,0)) -- cgit v1.2.3