(rules, rule, specificTokens, constructionState, rulesBucketIndex)
| 146925 | // In order to insert a rule to the end of sub-bucket (3), we get the index by adding |
| 146926 | // the values in the bitmap segments 3rd, 2nd, and 1st. |
| 146927 | function addRule(rules, rule, specificTokens, constructionState, rulesBucketIndex) { |
| 146928 | var position = rule.action & 3 /* RuleAction.StopAction */ ? |
| 146929 | specificTokens ? RulesPosition.StopRulesSpecific : RulesPosition.StopRulesAny : |
| 146930 | rule.context !== formatting.anyContext ? |
| 146931 | specificTokens ? RulesPosition.ContextRulesSpecific : RulesPosition.ContextRulesAny : |
| 146932 | specificTokens ? RulesPosition.NoContextRulesSpecific : RulesPosition.NoContextRulesAny; |
| 146933 | var state = constructionState[rulesBucketIndex] || 0; |
| 146934 | rules.splice(getInsertionIndex(state, position), 0, rule); |
| 146935 | constructionState[rulesBucketIndex] = increaseInsertionIndex(state, position); |
| 146936 | } |
| 146937 | function getInsertionIndex(indexBitmap, maskPosition) { |
| 146938 | var index = 0; |
| 146939 | for (var pos = 0; pos <= maskPosition; pos += maskBitSize) { |
no test coverage detected