code: function toggle(pos, state, ruleId) {
        var markers = ruleId ? scope[ruleId] : globals
        var currentState
        var previousState
  
        if (!markers) {
          markers = []
          scope[ruleId] = markers
        }
  
        previousState = getState(ruleId)
        currentState = state
  
        if (currentState !== previousState) {
          markers.push({state: currentState, position: pos})
        }
  
        /* Toggle all known rules. */
        if (!ruleId) {
          for (ruleId in scope) {
            toggle(pos, state, ruleId)
          }
        }
      }
docs: /* Handle a rule.