forked from Telodendria/Telodendria
Fix line counts on syntax errors.
This commit is contained in:
parent
72467f6503
commit
6e976a2b8d
1 changed files with 18 additions and 4 deletions
|
@ -171,6 +171,10 @@ HeaderConsumeArg(HeaderExpr * expr)
|
|||
{
|
||||
block--;
|
||||
}
|
||||
else if (c == '\n')
|
||||
{
|
||||
expr->state.lineNo++;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= len)
|
||||
|
@ -283,6 +287,10 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
|
|||
i++;
|
||||
expr->data.text[i] = c;
|
||||
i++;
|
||||
if (c == '\n')
|
||||
{
|
||||
expr->state.lineNo++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -367,6 +375,7 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
|
|||
if (c == '\n')
|
||||
{
|
||||
expr->data.text[i] = '\0';
|
||||
expr->state.lineNo++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -439,6 +448,10 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
|
|||
{
|
||||
block--;
|
||||
}
|
||||
else if (c == '\n')
|
||||
{
|
||||
expr->state.lineNo++;
|
||||
}
|
||||
|
||||
if (block <= 0 && c == ';')
|
||||
{
|
||||
|
@ -514,7 +527,8 @@ HeaderParse(Stream * stream, HeaderExpr * expr)
|
|||
|
||||
expr->data.declaration.args = ArrayCreate();
|
||||
|
||||
do {
|
||||
do
|
||||
{
|
||||
word = HeaderConsumeArg(expr);
|
||||
ArrayAdd(expr->data.declaration.args, word);
|
||||
word = NULL;
|
||||
|
|
Loading…
Reference in a new issue