components/code/src/command.rules.js
// A Name Token which will decorate the previous state with a `type`.
A Name Token which will decorate the previous state with a `type`.
A Name Token which will decorate the previous state with a ` type ` .
function type(style) {
		return {
			style: style,
			match: function match(token) {
				return token.kind === 'Name';
			},
			update: function update(state, token) {
				if (state.prevState && state.prevState.prevState) {
					state.name = token.value;
					state.prevState.prevState.type = token.value;
				}
			}
		};
	}
function type ( style ) { return { style : style , match : function match ( token ) { return token . kind === 'Name' ; } , update : function update ( state , token ) { if ( state . prevState && state . prevState . prevState ) { state . name = token . value ; state . prevState . prevState . type = token . value ; } } } ; }
A Name Token which will decorate the previous state with a `type`.
A Name Token which will decorate the previous state with a ` type ` .