()
| 3256 | |
| 3257 | Minimatch.prototype.make = make |
| 3258 | function make () { |
| 3259 | // don't do it more than once. |
| 3260 | if (this._made) return |
| 3261 | |
| 3262 | var pattern = this.pattern |
| 3263 | var options = this.options |
| 3264 | |
| 3265 | // empty patterns and comments match nothing. |
| 3266 | if (!options.nocomment && pattern.charAt(0) === '#') { |
| 3267 | this.comment = true |
| 3268 | return |
| 3269 | } |
| 3270 | if (!pattern) { |
| 3271 | this.empty = true |
| 3272 | return |
| 3273 | } |
| 3274 | |
| 3275 | // step 1: figure out negation, etc. |
| 3276 | this.parseNegate() |
| 3277 | |
| 3278 | // step 2: expand braces |
| 3279 | var set = this.globSet = this.braceExpand() |
| 3280 | |
| 3281 | if (options.debug) this.debug = console.error |
| 3282 | |
| 3283 | this.debug(this.pattern, set) |
| 3284 | |
| 3285 | // step 3: now we have a set, so turn each one into a series of path-portion |
| 3286 | // matching patterns. |
| 3287 | // These will be regexps, except in the case of "**", which is |
| 3288 | // set to the GLOBSTAR object for globstar behavior, |
| 3289 | // and will not contain any / characters |
| 3290 | set = this.globParts = set.map(function (s) { |
| 3291 | return s.split(slashSplit) |
| 3292 | }) |
| 3293 | |
| 3294 | this.debug(this.pattern, set) |
| 3295 | |
| 3296 | // glob --> regexps |
| 3297 | set = set.map(function (s, si, set) { |
| 3298 | return s.map(this.parse, this) |
| 3299 | }, this) |
| 3300 | |
| 3301 | this.debug(this.pattern, set) |
| 3302 | |
| 3303 | // filter out everything that didn't compile properly. |
| 3304 | set = set.filter(function (s) { |
| 3305 | return s.indexOf(false) === -1 |
| 3306 | }) |
| 3307 | |
| 3308 | this.debug(this.pattern, set) |
| 3309 | |
| 3310 | this.set = set |
| 3311 | } |
| 3312 | |
| 3313 | Minimatch.prototype.parseNegate = parseNegate |
| 3314 | function parseNegate () { |
no outgoing calls