eolian: different syntax for functions (func ret_type (arg_types))
This commit is contained in:
parent
dd22cf8148
commit
d5f4af5e61
|
@ -182,13 +182,6 @@ lex(Eo_Lexer *ls, const char **value, int *kwid, const char *chars)
|
|||
next_char(ls);
|
||||
continue;
|
||||
}
|
||||
case '-':
|
||||
{
|
||||
next_char(ls);
|
||||
if (ls->current != '>') return '-';
|
||||
next_char(ls);
|
||||
return TOK_ARROW;
|
||||
}
|
||||
case '\0':
|
||||
return TOK_EOF;
|
||||
default:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
enum Tokens
|
||||
{
|
||||
TOK_ARROW = START_CUSTOM, TOK_COMMENT, TOK_EOF, TOK_VALUE
|
||||
TOK_COMMENT = START_CUSTOM, TOK_EOF, TOK_VALUE
|
||||
};
|
||||
|
||||
#define KEYWORDS KW(class), KW(const), KW(private), KW(protected), \
|
||||
|
|
|
@ -156,11 +156,10 @@ parse_function_type(Eo_Lexer *ls)
|
|||
Eo_Type_Def *def = calloc(1, sizeof(Eo_Type_Def));
|
||||
ls->tmp.type_def = def;
|
||||
eo_lexer_get(ls);
|
||||
if (ls->t.token == TOK_ARROW)
|
||||
{
|
||||
eo_lexer_get(ls);
|
||||
def->ret_type = parse_type(ls);
|
||||
}
|
||||
if (ls->t.kw == KW_void)
|
||||
eo_lexer_get(ls);
|
||||
else
|
||||
def->ret_type = parse_type(ls);
|
||||
line = ls->line_number;
|
||||
check_next(ls, '(');
|
||||
if (ls->t.token != ')')
|
||||
|
|
Loading…
Reference in New Issue