fix typo
This commit is contained in:
parent
dfda85e870
commit
6a48c007a6
@ -146,7 +146,7 @@ FnDef : FnProto Block
|
|||||||
|
|
||||||
ParamDeclList : token(LParen) list(ParamDecl, token(Comma)) token(RParen)
|
ParamDeclList : token(LParen) list(ParamDecl, token(Comma)) token(RParen)
|
||||||
|
|
||||||
ParamDecl : token(Symbol) token(Colon) Type | token(Ellipse)
|
ParamDecl : token(Symbol) token(Colon) Type | token(Ellipsis)
|
||||||
|
|
||||||
Type : token(Symbol) | token(Unreachable) | token(Void) | PointerType | ArrayType
|
Type : token(Symbol) | token(Unreachable) | token(Void) | PointerType | ArrayType
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ static AstNode *ast_parse_type(ParseContext *pc, int token_index, int *new_token
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ParamDecl : token(Symbol) token(Colon) Type | token(Ellipse)
|
ParamDecl : token(Symbol) token(Colon) Type | token(Ellipsis)
|
||||||
*/
|
*/
|
||||||
static AstNode *ast_parse_param_decl(ParseContext *pc, int token_index, int *new_token_index) {
|
static AstNode *ast_parse_param_decl(ParseContext *pc, int token_index, int *new_token_index) {
|
||||||
Token *param_name = &pc->tokens->at(token_index);
|
Token *param_name = &pc->tokens->at(token_index);
|
||||||
@ -536,7 +536,7 @@ static AstNode *ast_parse_param_decl(ParseContext *pc, int token_index, int *new
|
|||||||
|
|
||||||
*new_token_index = token_index;
|
*new_token_index = token_index;
|
||||||
return node;
|
return node;
|
||||||
} else if (param_name->id == TokenIdEllipse) {
|
} else if (param_name->id == TokenIdEllipsis) {
|
||||||
*new_token_index = token_index;
|
*new_token_index = token_index;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
|
@ -337,7 +337,7 @@ void tokenize(Buf *buf, Tokenization *out) {
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
case '.':
|
case '.':
|
||||||
t.state = TokenizeStateDotDot;
|
t.state = TokenizeStateDotDot;
|
||||||
t.cur_tok->id = TokenIdEllipse;
|
t.cur_tok->id = TokenIdEllipsis;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
t.pos -= 1;
|
t.pos -= 1;
|
||||||
@ -672,7 +672,7 @@ static const char * token_name(Token *token) {
|
|||||||
case TokenIdSlash: return "Slash";
|
case TokenIdSlash: return "Slash";
|
||||||
case TokenIdPercent: return "Percent";
|
case TokenIdPercent: return "Percent";
|
||||||
case TokenIdDot: return "Dot";
|
case TokenIdDot: return "Dot";
|
||||||
case TokenIdEllipse: return "Ellipse";
|
case TokenIdEllipsis: return "Ellipsis";
|
||||||
}
|
}
|
||||||
return "(invalid token)";
|
return "(invalid token)";
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ enum TokenId {
|
|||||||
TokenIdSlash,
|
TokenIdSlash,
|
||||||
TokenIdPercent,
|
TokenIdPercent,
|
||||||
TokenIdDot,
|
TokenIdDot,
|
||||||
TokenIdEllipse,
|
TokenIdEllipsis,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Token {
|
struct Token {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user