Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/locfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ void locfile_locate(struct locfile* l, location loc, const char* fmt, ...) {
jv_free(m1);
return;
}
jv m2 = jv_string_fmt("%s at %s, line %d:\n%.*s%*s", jv_string_value(m1),
jv_string_value(l->fname), startline + 1,
jv m2 = jv_string_fmt("%s at %s, line %d, column %d:\n%.*s%*s",
jv_string_value(m1), jv_string_value(l->fname),
startline + 1, loc.start - offset + 1,
locfile_line_length(l, startline), l->data + offset,
loc.start - offset, "");
jv_free(m1);
Expand Down
28 changes: 14 additions & 14 deletions tests/jq.test
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ null

%%FAIL
{(0):1}
jq: error: Cannot use number (0) as object key at <top-level>, line 1:
jq: error: Cannot use number (0) as object key at <top-level>, line 1, column 2:

%%FAIL
{non_const:., (0):1}
jq: error: Cannot use number (0) as object key at <top-level>, line 1:
jq: error: Cannot use number (0) as object key at <top-level>, line 1, column 15:

#
# Field access, piping
Expand Down Expand Up @@ -300,7 +300,7 @@ null

%%FAIL
. as $foo | break $foo
jq: error: $*label-foo is not defined at <top-level>, line 1:
jq: error: $*label-foo is not defined at <top-level>, line 1, column 13:

[.[]|[.,1]|until(.[0] < 1; [.[0] - 1, .[1] * .[0]])|.[1]]
[1,2,3,4,5]
Expand Down Expand Up @@ -506,11 +506,11 @@ null

%%FAIL IGNORE MSG
. as [] | null
jq: error: syntax error, unexpected ']', expecting '$' or '[' or '{' (Unix shell quoting issues?) at <top-level>, line 1:
jq: error: syntax error, unexpected ']', expecting '$' or '[' or '{' (Unix shell quoting issues?) at <top-level>, line 1, column 7:

%%FAIL IGNORE MSG
. as {} | null
jq: error: syntax error, unexpected '}' (Unix shell quoting issues?) at <top-level>, line 1:
jq: error: syntax error, unexpected '}' (Unix shell quoting issues?) at <top-level>, line 1, column 7:

# [.,(.[] | {x:.},.),.,.[]]

Expand Down Expand Up @@ -1738,27 +1738,27 @@ null

%%FAIL
module (.+1); 0
jq: error: Module metadata must be constant at <top-level>, line 1:
jq: error: Module metadata must be constant at <top-level>, line 1, column 1:

%%FAIL
module []; 0
jq: error: Module metadata must be an object at <top-level>, line 1:
jq: error: Module metadata must be an object at <top-level>, line 1, column 1:

%%FAIL
include "a" (.+1); 0
jq: error: Module metadata must be constant at <top-level>, line 1:
jq: error: Module metadata must be constant at <top-level>, line 1, column 1:

%%FAIL
include "a" []; 0
jq: error: Module metadata must be an object at <top-level>, line 1:
jq: error: Module metadata must be an object at <top-level>, line 1, column 1:

%%FAIL
include "\ "; 0
jq: error: Invalid escape at line 1, column 4 (while parsing '"\ "') at <top-level>, line 1:
jq: error: Invalid escape at line 1, column 4 (while parsing '"\ "') at <top-level>, line 1, column 10:

%%FAIL
include "\(a)"; 0
jq: error: Import path must be constant at <top-level>, line 1:
jq: error: Import path must be constant at <top-level>, line 1, column 9:

modulemeta
"c"
Expand All @@ -1774,11 +1774,11 @@ modulemeta | .defs | length

%%FAIL IGNORE MSG
import "syntaxerror" as e; .
jq: error: syntax error, unexpected ';', expecting $end (Unix shell quoting issues?) at /home/nico/ws/jq/tests/modules/syntaxerror/syntaxerror.jq, line 1:
jq: error: syntax error, unexpected ';', expecting $end (Unix shell quoting issues?) at /home/nico/ws/jq/tests/modules/syntaxerror/syntaxerror.jq, line 1, column 8:

%%FAIL IGNORE MSG
%::wat
jq: error: syntax error, unexpected '%', expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
jq: error: syntax error, unexpected '%', expecting $end (Unix shell quoting issues?) at <top-level>, line 1, column 1:

import "test_bind_order" as check; check::check
null
Expand Down Expand Up @@ -1846,7 +1846,7 @@ null

%%FAIL IGNORE MSG
}
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1, column 1:

(.[{}] = 0)?
null
Expand Down
Loading