Improve invalid object key error message
This commit is contained in:
1 parent
1758c1ba74
commit
b52bebfbe8
2 files changed
+803
-796
No files matched your search
+795
-795
File diff suppressed because it is too large.
Load diff
+8
-1
@@ -809,6 +809,10 @@ String ':' Pattern {
|
||||
} |
|
||||
'(' Exp ')' ':' Pattern {
|
||||
$$ = gen_object_matcher($2, $5);
|
||||
} |
|
||||
error ':' Pattern {
|
||||
FAIL(@$, "May need parentheses around object key");
|
||||
$$ = $3;
|
||||
}
|
||||
|
||||
Keyword:
|
||||
@@ -903,7 +907,10 @@ IDENT ':' ExpD {
|
||||
| '(' Exp ')' ':' ExpD {
|
||||
$$ = gen_dictpair($2, $5);
|
||||
}
|
||||
| '(' error ')' ':' ExpD { $$ = $5; }
|
||||
| error ':' ExpD {
|
||||
FAIL(@$, "May need parentheses around object key");
|
||||
$$ = $3;
|
||||
}
|
||||
%%
|
||||
|
||||
int jq_parse(struct locfile* locations, block* answer) {
|
||||
|
||||
Reference in new issue
Block a user