Support ."foo" syntax for accessing fields. See #141.

This commit is contained in:
Stephen Dolan committed 2013-06-11 22:26:39 +01:00
1 parent c8ab67be27
commit 81e2336ace
3 files changed
+17 -1

No files matched your search

+6
View File
@@ -406,6 +406,12 @@ Term FIELD {
FIELD {
$$ = gen_index(gen_noop(), gen_const($1));
} |
Term '.' String {
$$ = gen_index($1, $3);
} |
'.' String {
$$ = gen_index(gen_noop(), $2);
} |
'.' error {
FAIL(@$, "try .[\"field\"] instead of .field for unusually named fields");
$$ = gen_noop();