mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Add "return" to pascal.
I'm still not sure I'll keep it, but it's useful for testing.
This commit is contained in:
parent
e7424e1496
commit
54c14eb899
2 changed files with 7 additions and 0 deletions
|
@ -227,6 +227,8 @@ static keyword_t keywords[] = {
|
||||||
{"mod", MULOP, 0},
|
{"mod", MULOP, 0},
|
||||||
{"and", MULOP, 0},
|
{"and", MULOP, 0},
|
||||||
{"not", NOT, 0},
|
{"not", NOT, 0},
|
||||||
|
|
||||||
|
{"return", RETURN, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
|
|
@ -126,6 +126,7 @@ int yylex (void);
|
||||||
|
|
||||||
%token PROGRAM VAR ARRAY OF FUNCTION PROCEDURE PBEGIN END IF THEN ELSE
|
%token PROGRAM VAR ARRAY OF FUNCTION PROCEDURE PBEGIN END IF THEN ELSE
|
||||||
%token WHILE DO RANGE ASSIGNOP NOT ELLIPSIS
|
%token WHILE DO RANGE ASSIGNOP NOT ELLIPSIS
|
||||||
|
%token RETURN
|
||||||
|
|
||||||
%type <type> type standard_type
|
%type <type> type standard_type
|
||||||
%type <symbol> program_head identifier_list subprogram_head
|
%type <symbol> program_head identifier_list subprogram_head
|
||||||
|
@ -379,6 +380,10 @@ statement
|
||||||
new_label_expr (),
|
new_label_expr (),
|
||||||
new_label_expr ());
|
new_label_expr ());
|
||||||
}
|
}
|
||||||
|
| RETURN
|
||||||
|
{
|
||||||
|
$$ = return_expr (current_func, 0);
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
variable
|
variable
|
||||||
|
|
Loading…
Reference in a new issue