Skip to content

Commit

Permalink
support noparen in scan
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Oct 31, 2019
1 parent 0159b55 commit 3d37569
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/scan.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const utils = require('./utils');

const {
CHAR_ASTERISK, /* * */
CHAR_AT, /* @ */
Expand All @@ -17,7 +16,7 @@ const {
CHAR_QUESTION_MARK, /* ? */
CHAR_RIGHT_CURLY_BRACE, /* } */
CHAR_RIGHT_PARENTHESES, /* ) */
CHAR_RIGHT_SQUARE_BRACKET /* ] */
CHAR_RIGHT_SQUARE_BRACKET /* ] */
} = require('./constants');

const isPathSeparator = code => {
Expand Down Expand Up @@ -160,15 +159,15 @@ module.exports = (input, options) => {
continue;
}

if (code === CHAR_LEFT_PARENTHESES) {
while (!eos() && (next = advance())) {
if (next === CHAR_BACKWARD_SLASH) {
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
while (!eos() && (code = advance())) {
if (code === CHAR_BACKWARD_SLASH) {
backslashes = true;
next = advance();
code = advance();
continue;
}

if (next === CHAR_RIGHT_PARENTHESES) {
if (code === CHAR_RIGHT_PARENTHESES) {
isGlob = true;
break;
}
Expand Down

0 comments on commit 3d37569

Please sign in to comment.