diff --git a/tools/qfcc/source/qp-lex.l b/tools/qfcc/source/qp-lex.l index 8d951daa0..c01b59351 100644 --- a/tools/qfcc/source/qp-lex.l +++ b/tools/qfcc/source/qp-lex.l @@ -227,6 +227,8 @@ static keyword_t keywords[] = { {"mod", MULOP, 0}, {"and", MULOP, 0}, {"not", NOT, 0}, + + {"return", RETURN, 0}, }; static const char * diff --git a/tools/qfcc/source/qp-parse.y b/tools/qfcc/source/qp-parse.y index 72cbc0f7e..e54160e85 100644 --- a/tools/qfcc/source/qp-parse.y +++ b/tools/qfcc/source/qp-parse.y @@ -126,6 +126,7 @@ int yylex (void); %token PROGRAM VAR ARRAY OF FUNCTION PROCEDURE PBEGIN END IF THEN ELSE %token WHILE DO RANGE ASSIGNOP NOT ELLIPSIS +%token RETURN %type type standard_type %type program_head identifier_list subprogram_head @@ -379,6 +380,10 @@ statement new_label_expr (), new_label_expr ()); } + | RETURN + { + $$ = return_expr (current_func, 0); + } ; variable