Lines Matching refs:position
31 // 4. Let position point at the start of input.
32 const position = { position: 0 }
36 // to U+002C (,), given position.
40 position
52 // 7. If position is past the end of input, then
54 if (position.position >= input.length) {
58 // 8. Advance position by 1.
59 position.position++
136 * @param {{ position: number }} position
138 function collectASequenceOfCodePoints (condition, input, position) {
142 // 2. While position doesn’t point past the end of input and the
143 // code point at position within input meets the condition condition:
144 while (position.position < input.length && condition(input[position.position])) {
146 result += input[position.position]
148 // 2. Advance position by 1.
149 position.position++
160 * @param {{ position: number }} position
162 function collectASequenceOfCodePointsFast (char, input, position) {
163 const idx = input.indexOf(char, position.position)
164 const start = position.position
167 position.position = input.length
171 position.position = idx
172 return input.slice(start, position.position)
237 // 2. Let position be a position variable for input,
239 const position = { position: 0 }
243 // input, given position.
247 position
257 // 5. If position is past the end of input, then return
259 if (position.position > input.length) {
263 // 6. Advance position by 1. (This skips past U+002F (/).)
264 position.position++
268 // position.
272 position
300 // 11. While position is not past the end of input:
301 while (position.position < input.length) {
302 // 1. Advance position by 1. (This skips past U+003B (;).)
303 position.position++
306 // whitespace from input given position.
311 position
316 // or U+003D (=) from input, given position.
320 position
327 // 5. If position is not past the end of input, then:
328 if (position.position < input.length) {
329 // 1. If the code point at position within input is
331 if (input[position.position] === ';') {
335 // 2. Advance position by 1. (This skips past U+003D (=).)
336 position.position++
339 // 6. If position is past the end of input, then break.
340 if (position.position > input.length) {
347 // 8. If the code point at position within input is
349 if (input[position.position] === '"') {
351 // an HTTP quoted string from input, given position
353 parameterValue = collectAnHTTPQuotedString(input, position, true)
356 // U+003B (;) from input, given position.
360 position
367 // from input, given position.
371 position
446 * @param {{ position: number }} position
449 function collectAnHTTPQuotedString (input, position, extractValue) {
450 // 1. Let positionStart be position.
451 const positionStart = position.position
456 // 3. Assert: the code point at position within input
458 assert(input[position.position] === '"')
460 // 4. Advance position by 1.
461 position.position++
467 // position, to value.
471 position
474 // 2. If position is past the end of input, then break.
475 if (position.position >= input.length) {
479 // 3. Let quoteOrBackslash be the code point at position within
481 const quoteOrBackslash = input[position.position]
483 // 4. Advance position by 1.
484 position.position++
488 // 1. If position is past the end of input, then append
490 if (position.position >= input.length) {
495 // 2. Append the code point at position within input to value.
496 value += input[position.position]
498 // 3. Advance position by 1.
499 position.position++
516 // 7. Return the code points from positionStart to position,
518 return input.slice(positionStart, position.position)