Fix line numbers - commands are added after the line ends so they need to

get line - 1.
This commit is contained in:
nicm
2019-05-23 18:39:00 +00:00
parent 6c260af56d
commit f3e01ecc42
2 changed files with 3 additions and 2 deletions

View File

@ -356,7 +356,7 @@ command : assignment TOKEN
$$ = xcalloc(1, sizeof *$$);
$$->name = $2;
$$->line = ps->input->line;
$$->line = ps->input->line - 1;
}
| assignment TOKEN arguments
@ -365,7 +365,7 @@ command : assignment TOKEN
$$ = xcalloc(1, sizeof *$$);
$$->name = $2;
$$->line = ps->input->line;
$$->line = ps->input->line - 1;
$$->argc = $3.argc;
$$->argv = $3.argv;