mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Update parsers
This commit is contained in:
@@ -1129,7 +1129,7 @@ token_precedence :: proc(p: ^Parser, kind: token.Kind) -> int {
|
|||||||
switch kind {
|
switch kind {
|
||||||
case token.Question:
|
case token.Question:
|
||||||
return 1;
|
return 1;
|
||||||
case token.Ellipsis:
|
case token.Ellipsis, token.Range_Half:
|
||||||
if !p.allow_range {
|
if !p.allow_range {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ using Kind :: enum u32 {
|
|||||||
Period,
|
Period,
|
||||||
Comma,
|
Comma,
|
||||||
Ellipsis,
|
Ellipsis,
|
||||||
|
Range_Half,
|
||||||
Back_Slash,
|
Back_Slash,
|
||||||
B_Operator_End,
|
B_Operator_End,
|
||||||
|
|
||||||
@@ -244,6 +245,7 @@ tokens := [Kind.COUNT]string {
|
|||||||
".",
|
".",
|
||||||
",",
|
",",
|
||||||
"..",
|
"..",
|
||||||
|
"..<",
|
||||||
"\\",
|
"\\",
|
||||||
"",
|
"",
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2144,9 +2144,9 @@ Ast *parse_call_expr(AstFile *f, Ast *operand) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool prefix_ellipsis = false;
|
bool prefix_ellipsis = false;
|
||||||
if (is_token_range(f->curr_token)) {
|
if (f->curr_token.kind == Token_Ellipsis) {
|
||||||
prefix_ellipsis = true;
|
prefix_ellipsis = true;
|
||||||
ellipsis = expect_token(f, f->curr_token.kind);
|
ellipsis = expect_token(f, Token_Ellipsis);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ast *arg = parse_expr(f, false);
|
Ast *arg = parse_expr(f, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user