func lexRightBracket(t *Tokeniser) stateFunc {
	r, w := t.currentRune()
	if t.bracketStack.empty() {
		t.emitErrorf("unexpected right bracket %#U", r)
		return nil
	} else if toCheck := t.bracketStack.pop(); toCheck != rightBracketToLeftMap[r] {
		t.emitErrorf("unexpected right bracket %#U, expected %#U", r, rightBracketToLeftMap[r])
		return nil
	}
	t.advance(w)
	switch r {
	case ')':
		t.emit(RROUND)
	case '}':
		t.emit(RCURLY)
	case ']':
		t.emit(RSQUARE)
	}
	return lexCode
}
// lexRightBracket scans for a right bracket (curly, round, square)
lexRightBracket scans for a right bracket (curly, round, square)
// lexRightBracket scans for a right bracket ( curly round square )
func lexRightBracket(t *Tokeniser) stateFunc {
	r, w := t.currentRune()
	if t.bracketStack.empty() {
		t.emitErrorf("unexpected right bracket %#U", r)
		return nil
	} else if toCheck := t.bracketStack.pop(); toCheck != rightBracketToLeftMap[r] {
		t.emitErrorf("unexpected right bracket %#U, expected %#U", r, rightBracketToLeftMap[r])
		return nil
	}
	t.advance(w)
	switch r {
	case ')':
		t.emit(RROUND)
	case '}':
		t.emit(RCURLY)
	case ']':
		t.emit(RSQUARE)
	}
	return lexCode
}
func lexRightBracket ( t * Tokeniser ) stateFunc { r , w := t . currentRune ( ) if t . bracketStack . empty ( ) { t . emitErrorf ( " " , r ) return nil } else if toCheck := t . bracketStack . pop ( ) ; toCheck != rightBracketToLeftMap [ r ] { t . emitErrorf ( " " , r , rightBracketToLeftMap [ r ] ) return nil } t . advance ( w ) switch r { case ')' : t . emit ( RROUND ) case '}' : t . emit ( RCURLY ) case ']' : t . emit ( RSQUARE ) } return lexCode }
lexRightBracket scans for a right bracket (curly, round, square)
lexRightBracket scans for a right bracket ( curly round square )