components/code/src/command.rules.js
// Advance the step of the current rule.
Advance the step of the current rule.
Advance the step of the current rule .
function advanceRule(state, successful) {
		if (isList(state)) {
			if (state.rule && state.rule[state.step].separator) {
				var separator = state.rule[state.step].separator;
				state.needsSeperator = !state.needsSeperator;
				if (!state.needsSeperator && separator.ofRule) {
					return;
				}
			}
			if (successful) {
				return;
			}
		}
		state.needsSeperator = false;
		state.step++;
		while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) {
			popRule(state);
			if (state.rule) {
				if (isList(state)) {
					if (state.rule && state.rule[state.step].separator) {
						state.needsSeperator = !state.needsSeperator;
					}
				} else {
					state.needsSeperator = false;
					state.step++;
				}
			}
		}
	}
function advanceRule ( state , successful ) { if ( isList ( state ) ) { if ( state . rule && state . rule [ state . step ] . separator ) { var separator = state . rule [ state . step ] . separator ; state . needsSeperator = ! state . needsSeperator ; if ( ! state . needsSeperator && separator . ofRule ) { return ; } } if ( successful ) { return ; } } state . needsSeperator = false ; state . step ++ ; while ( state . rule && ! ( Array . isArray ( state . rule ) && state . step < state . rule . length ) ) { popRule ( state ) ; if ( state . rule ) { if ( isList ( state ) ) { if ( state . rule && state . rule [ state . step ] . separator ) { state . needsSeperator = ! state . needsSeperator ; } } else { state . needsSeperator = false ; state . step ++ ; } } } }
Advance the step of the current rule.
Advance the step of the current rule .
// If this is advancing successfully and the current state is a list, give // it an opportunity to repeat itself. // If the separator was optional, then give it an opportunity to repeat. // If this was a successful list parse, then allow it to repeat itself. // Advance the step in the rule. If the rule is completed, pop // the rule and advance the parent rule as well (recursively). // While the current rule is completed. // Do not advance a List step so it has the opportunity to repeat itself.