Skip to content

Commit edd8fc5

Browse files
committed
Fix internal terminology
1 parent 5a455ca commit edd8fc5

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

lib/nest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ handle.unknown = unknownNesting
1515
handle.invalid = topScan // `undefined` is the top query selector.
1616
handlers.null = descendant // `null` is the descendant combinator.
1717
handlers['>'] = child
18-
handlers['+'] = adjacentSibling
19-
handlers['~'] = generalSibling
18+
handlers['+'] = nextSibling
19+
handlers['~'] = subsequentSibling
2020

2121
function match(query, node, index, parent, state) {
2222
return handle(query, node, index, parent, state)
@@ -70,7 +70,7 @@ function child(query, node, index, parent, state) {
7070
.done()
7171
}
7272

73-
function adjacentSibling(query, node, index, parent, state) {
73+
function nextSibling(query, node, index, parent, state) {
7474
/* istanbul ignore if - Shouldn’t happen. */
7575
if (!parent) {
7676
return
@@ -83,7 +83,7 @@ function adjacentSibling(query, node, index, parent, state) {
8383
.done()
8484
}
8585

86-
function generalSibling(query, node, index, parent, state) {
86+
function subsequentSibling(query, node, index, parent, state) {
8787
/* istanbul ignore if - Shouldn’t happen. */
8888
if (!parent) {
8989
return

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ Yields:
176176
* [x] `#id` (id selector)
177177
* [x] `article p` (combinator: descendant selector)
178178
* [x] `article > p` (combinator: child selector)
179-
* [x] `h1 + p` (combinator: adjacent sibling selector)
180-
* [x] `h1 ~ p` (combinator: general sibling selector)
179+
* [x] `h1 + p` (combinator: next-sibling selector)
180+
* [x] `h1 ~ p` (combinator: subsequent sibling selector)
181181
* [x] `[attr]` (attribute existence)
182182
* [x] `[attr=value]` (attribute equality)
183183
* [x] `[attr~=value]` (attribute contains in space-separated list)

test/select-all.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ test('select.selectAll()', function(t) {
167167
st.end()
168168
})
169169

170-
t.test('adjacent sibling selector', function(st) {
170+
t.test('next-sibling selector', function(st) {
171171
st.deepEqual(
172172
selectAll(
173173
'h1 + p',
@@ -180,7 +180,7 @@ test('select.selectAll()', function(t) {
180180
])
181181
),
182182
[h('p', 'Charlie')],
183-
'should return adjacent sibling'
183+
'should return next-sibling'
184184
)
185185

186186
st.deepEqual(
@@ -200,7 +200,7 @@ test('select.selectAll()', function(t) {
200200
st.end()
201201
})
202202

203-
t.test('general sibling selector', function(st) {
203+
t.test('subsequent sibling selector', function(st) {
204204
st.deepEqual(
205205
selectAll(
206206
'h1 ~ p',
@@ -213,7 +213,7 @@ test('select.selectAll()', function(t) {
213213
])
214214
),
215215
[h('p', 'Charlie'), h('p', 'Delta')],
216-
'should return adjacent sibling'
216+
'should return subsequent sibling'
217217
)
218218

219219
st.deepEqual(
@@ -227,7 +227,7 @@ test('select.selectAll()', function(t) {
227227
])
228228
),
229229
[h('p', 'Delta')],
230-
'should return future siblings'
230+
'should return subsequent siblings'
231231
)
232232

233233
st.deepEqual(

test/select.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test('select.select()', function(t) {
148148
st.end()
149149
})
150150

151-
t.test('adjacent sibling selector', function(st) {
151+
t.test('next-sibling selector', function(st) {
152152
st.deepEqual(
153153
select(
154154
'h1 + p',
@@ -161,7 +161,7 @@ test('select.select()', function(t) {
161161
])
162162
),
163163
h('p', 'Charlie'),
164-
'should return adjacent sibling'
164+
'should return next-sibling'
165165
)
166166

167167
st.equal(
@@ -181,7 +181,7 @@ test('select.select()', function(t) {
181181
st.end()
182182
})
183183

184-
t.test('general sibling selector', function(st) {
184+
t.test('subsequent sibling selector', function(st) {
185185
st.deepEqual(
186186
select(
187187
'h1 ~ p',
@@ -194,7 +194,7 @@ test('select.select()', function(t) {
194194
])
195195
),
196196
h('p', 'Charlie'),
197-
'should return the first adjacent sibling'
197+
'should return the first subsequent sibling'
198198
)
199199

200200
st.deepEqual(
@@ -208,7 +208,7 @@ test('select.select()', function(t) {
208208
])
209209
),
210210
h('p', 'Delta'),
211-
'should return future siblings'
211+
'should return subsequent siblings'
212212
)
213213

214214
st.equal(

0 commit comments

Comments
 (0)