Repository navigation
Commit e04fa4e
committed
fix: support unions that mix quoted names with other selectors
A union with a quoted name next to any other kind of selector found
nothing for the quoted name: $['a',1] returned only the index, $[*,'a']
dropped the name, and $..['io.nest',out] (the last example in #159)
returned only `out`. toPathArray only kept unions of quoted names
intact, so a mixed one was split at the commas with the quotes still
stuck to the pieces.
toPathArray now keeps any well formed union that has a quoted member
intact, and _trace traces the members in order: quoted ones as literal
names, the rest (indexes, slices, wildcards, bare names) as usual.
Unions without quotes are unchanged, so $[x, y] still treats the space
as part of the name.1 parent 970bdb2 commit e04fa4e
2 files changed
Lines changed: 73 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
868 | 871 | | |
869 | 872 | | |
870 | 873 | | |
871 | | - | |
872 | | - | |
873 | | - | |
874 | | - | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
875 | 880 | | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
876 | 895 | | |
877 | 896 | | |
878 | 897 | | |
| |||
1237 | 1256 | | |
1238 | 1257 | | |
1239 | 1258 | | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1243 | 1263 | | |
1244 | | - | |
| 1264 | + | |
1245 | 1265 | | |
1246 | | - | |
| 1266 | + | |
1247 | 1267 | | |
1248 | 1268 | | |
1249 | 1269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
63 | 107 | | |
64 | 108 | | |
65 | 109 | | |
| |||
0 commit comments