nl_tokens: Checks if the current argument should be left for an optional argument .
pl_tokens: function ( expected , expectedIndex , actual , actualIndex ) { // Check how many optional types in front of this argument that match the current value. var consecutiveOptionals = countTrailingOptionals_ ( expected , expectedIndex , actual [ actualIndex ] ) ; // Check how many required types are behind this argument that match the current value. We // will then use this value to determine if the current argument can be allowed to fill an // optional spot instead of a required one. var matchingRequires = countLeadingMatchingRequires_ ( expected , expectedIndex , actual [ actualIndex ] ) ; // Now that we have found the consecutive matching types, more forward through the arguments // to see if there are enough to fill the option types. var matchesRequired = 1 + matchingRequires ; var availableDistance = matchingRequires + consecutiveOptionals ; // Determine if there are enough optional arguments. var i = actualIndex - 1 ; var type = expected [ expectedIndex ] ; while ( i >= 0 && availableDistance > 0 && matchesRequired > 0 ) { if ( isOfType ( <mask> [ i ] , type ) ) { matchesRequired -- ; } availableDistance -- ; i -- ; } return matchesRequired <= 0 ; }