mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-11 22:01:25 -07:00
Minor changes
This commit is contained in:
@@ -193,9 +193,9 @@ gb_global ImplicitValueInfo implicit_value_infos[ImplicitValue_Count] = {0};
|
||||
|
||||
|
||||
typedef struct CheckerContext {
|
||||
Scope * scope;
|
||||
DeclInfo *decl;
|
||||
u32 stmt_state_flags;
|
||||
Scope * scope;
|
||||
DeclInfo * decl;
|
||||
u32 stmt_state_flags;
|
||||
} CheckerContext;
|
||||
|
||||
#define MAP_TYPE TypeAndValue
|
||||
|
||||
+7
-2
@@ -2070,7 +2070,7 @@ AstNode *parse_proc_type(AstFile *f) {
|
||||
}
|
||||
|
||||
|
||||
AstNodeArray parse_parameter_list(AstFile *f) {
|
||||
AstNodeArray parse_parameter_list(AstFile *f, bool allow_using) {
|
||||
AstNodeArray params = make_ast_node_array(f);
|
||||
|
||||
while (f->curr_token.kind == Token_Ident ||
|
||||
@@ -2090,6 +2090,11 @@ AstNodeArray parse_parameter_list(AstFile *f) {
|
||||
is_using = false;
|
||||
}
|
||||
|
||||
if (!allow_using && is_using) {
|
||||
syntax_error(f->curr_token, "`using` is not allowed within this parameter list");
|
||||
is_using = false;
|
||||
}
|
||||
|
||||
expect_token_after(f, Token_Colon, "parameter list");
|
||||
|
||||
AstNode *type = NULL;
|
||||
@@ -2405,7 +2410,7 @@ Token parse_proc_signature(AstFile *f,
|
||||
AstNodeArray *results) {
|
||||
Token proc_token = expect_token(f, Token_proc);
|
||||
expect_token(f, Token_OpenParen);
|
||||
*params = parse_parameter_list(f);
|
||||
*params = parse_parameter_list(f, true);
|
||||
expect_token_after(f, Token_CloseParen, "parameter list");
|
||||
*results = parse_results(f);
|
||||
return proc_token;
|
||||
|
||||
+6
-5
@@ -4,11 +4,11 @@
|
||||
TOKEN_KIND(Token_Comment, "Comment"), \
|
||||
\
|
||||
TOKEN_KIND(Token__LiteralBegin, "_LiteralBegin"), \
|
||||
TOKEN_KIND(Token_Ident, "Identifier"), \
|
||||
TOKEN_KIND(Token_Integer, "Integer"), \
|
||||
TOKEN_KIND(Token_Float, "Float"), \
|
||||
TOKEN_KIND(Token_Rune, "Rune"), \
|
||||
TOKEN_KIND(Token_String, "String"), \
|
||||
TOKEN_KIND(Token_Ident, "identifier"), \
|
||||
TOKEN_KIND(Token_Integer, "integer"), \
|
||||
TOKEN_KIND(Token_Float, "float"), \
|
||||
TOKEN_KIND(Token_Rune, "rune"), \
|
||||
TOKEN_KIND(Token_String, "string"), \
|
||||
TOKEN_KIND(Token__LiteralEnd, "_LiteralEnd"), \
|
||||
\
|
||||
TOKEN_KIND(Token__OperatorBegin, "_OperatorBegin"), \
|
||||
@@ -87,6 +87,7 @@ TOKEN_KIND(Token__KeywordBegin, "_KeywordBegin"), \
|
||||
/* TOKEN_KIND(Token_import, "import"), */\
|
||||
/* TOKEN_KIND(Token_include, "include"), */\
|
||||
TOKEN_KIND(Token_proc, "proc"), \
|
||||
TOKEN_KIND(Token_macro, "macro"), \
|
||||
TOKEN_KIND(Token_match, "match"), \
|
||||
TOKEN_KIND(Token_break, "break"), \
|
||||
TOKEN_KIND(Token_continue, "continue"), \
|
||||
|
||||
Reference in New Issue
Block a user