parser: Set the position of a call to the open parenthesis
This commit is contained in:
parent
3469623fee
commit
fd24623c27
1 changed files with 5 additions and 3 deletions
|
|
@ -394,6 +394,7 @@ err_unexpected_eof_after(enum apfl_token_type token_type, struct apfl_position p
|
|||
static bool fragments_to_call(
|
||||
apfl_parser_ptr,
|
||||
struct fragment_list *,
|
||||
struct apfl_position position,
|
||||
struct apfl_expr *
|
||||
);
|
||||
|
||||
|
|
@ -464,7 +465,7 @@ parse_parens(apfl_parser_ptr p, struct fragment *out, struct apfl_position posit
|
|||
out->type = FRAG_EXPR;
|
||||
out->position = position;
|
||||
|
||||
if (!fragments_to_call(p, &children, &out->expr)) {
|
||||
if (!fragments_to_call(p, &children, position, &out->expr)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -1307,12 +1308,13 @@ static bool
|
|||
fragments_to_call(
|
||||
apfl_parser_ptr p,
|
||||
struct fragment_list *fragments, // \mystuff\TODO:really a pointer? Why?
|
||||
struct apfl_position position,
|
||||
struct apfl_expr *out
|
||||
) {
|
||||
assert(fragments->len > 0); // \mystuff\TODO: Or should we check this here?
|
||||
|
||||
out->type = APFL_EXPR_CALL;
|
||||
out->position = fragments->children[0].position;
|
||||
out->position = position;
|
||||
out->call.arguments = (struct apfl_expr_list) {
|
||||
.items = NULL,
|
||||
.len = 0,
|
||||
|
|
@ -1382,7 +1384,7 @@ parse_body_or_toplevel_finalize(
|
|||
goto error;
|
||||
}
|
||||
} else {
|
||||
if (!fragments_to_call(p, fragments, dest)) {
|
||||
if (!fragments_to_call(p, fragments, fragments->children[0].position, dest)) {
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue