Skip to content

Commit 8754221

Browse files
committed
Mark lexer methods as private via '__'
1 parent 05d93dd commit 8754221

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

jmespath.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
while (this.current < stream.length) {
234234
if (isAlpha(stream[this.current])) {
235235
start = this.current;
236-
identifier = this.consumeUnquotedIdentifier(stream);
236+
identifier = this.__consumeUnquotedIdentifier(stream);
237237
tokens.push({type: TOK_UNQUOTEDIDENTIFIER,
238238
value: identifier,
239239
start: start});
@@ -243,33 +243,33 @@
243243
start: this.current});
244244
this.current++;
245245
} else if (isNum(stream[this.current])) {
246-
token = this.consumeNumber(stream);
246+
token = this.__consumeNumber(stream);
247247
tokens.push(token);
248248
} else if (stream[this.current] === "[") {
249249
// No need to increment this.current. This happens
250-
// in consumeLBracket
251-
token = this.consumeLBracket(stream);
250+
// in __consumeLBracket
251+
token = this.__consumeLBracket(stream);
252252
tokens.push(token);
253253
} else if (stream[this.current] === "\"") {
254254
start = this.current;
255-
identifier = this.consumeQuotedIdentifier(stream);
255+
identifier = this.__consumeQuotedIdentifier(stream);
256256
tokens.push({type: TOK_QUOTEDIDENTIFIER,
257257
value: identifier,
258258
start: start});
259259
} else if (stream[this.current] === "'") {
260260
start = this.current;
261-
identifier = this.consumeRawStringLiteral(stream);
261+
identifier = this.__consumeRawStringLiteral(stream);
262262
tokens.push({type: TOK_LITERAL,
263263
value: identifier,
264264
start: start});
265265
} else if (stream[this.current] === "`") {
266266
start = this.current;
267-
var literal = this.consumeLiteral(stream);
267+
var literal = this.__consumeLiteral(stream);
268268
tokens.push({type: TOK_LITERAL,
269269
value: literal,
270270
start: start});
271271
} else if (operatorStartToken[stream[this.current]] !== undefined) {
272-
tokens.push(this.consumeOperator(stream));
272+
tokens.push(this.__consumeOperator(stream));
273273
} else if (skipChars[stream[this.current]] !== undefined) {
274274
// Ignore whitespace.
275275
this.current++;
@@ -300,7 +300,7 @@
300300
return tokens;
301301
},
302302

303-
consumeUnquotedIdentifier: function(stream) {
303+
__consumeUnquotedIdentifier: function(stream) {
304304
var start = this.current;
305305
this.current++;
306306
while (this.current < stream.length && isAlphaNum(stream[this.current])) {
@@ -309,7 +309,7 @@
309309
return stream.slice(start, this.current);
310310
},
311311

312-
consumeQuotedIdentifier: function(stream) {
312+
__consumeQuotedIdentifier: function(stream) {
313313
var start = this.current;
314314
this.current++;
315315
var maxLength = stream.length;
@@ -328,7 +328,7 @@
328328
return JSON.parse(stream.slice(start, this.current));
329329
},
330330

331-
consumeRawStringLiteral: function(stream) {
331+
__consumeRawStringLiteral: function(stream) {
332332
var start = this.current;
333333
this.current++;
334334
var maxLength = stream.length;
@@ -348,7 +348,7 @@
348348
return literal.replace("\\'", "'");
349349
},
350350

351-
consumeNumber: function(stream) {
351+
__consumeNumber: function(stream) {
352352
var start = this.current;
353353
this.current++;
354354
var maxLength = stream.length;
@@ -359,7 +359,7 @@
359359
return {type: TOK_NUMBER, value: value, start: start};
360360
},
361361

362-
consumeLBracket: function(stream) {
362+
__consumeLBracket: function(stream) {
363363
var start = this.current;
364364
this.current++;
365365
if (stream[this.current] === "?") {
@@ -373,7 +373,7 @@
373373
}
374374
},
375375

376-
consumeOperator: function(stream) {
376+
__consumeOperator: function(stream) {
377377
var start = this.current;
378378
var startingChar = stream[start];
379379
this.current++;
@@ -406,7 +406,7 @@
406406
}
407407
},
408408

409-
consumeLiteral: function(stream) {
409+
__consumeLiteral: function(stream) {
410410
this.current++;
411411
var start = this.current;
412412
var maxLength = stream.length;
@@ -424,7 +424,7 @@
424424
}
425425
var literalString = trimLeft(stream.slice(start, this.current));
426426
literalString = literalString.replace("\\`", "`");
427-
if (this.looksLikeJSON(literalString)) {
427+
if (this.__looksLikeJSON(literalString)) {
428428
literal = JSON.parse(literalString);
429429
} else {
430430
// Try to JSON parse it as "<literal>"
@@ -435,7 +435,7 @@
435435
return literal;
436436
},
437437

438-
looksLikeJSON: function(literalString) {
438+
__looksLikeJSON: function(literalString) {
439439
var startingChars = "[{\"";
440440
var jsonLiterals = ["true", "false", "null"];
441441
var numberLooking = "-0123456789";

0 commit comments

Comments
 (0)