private static Matcher match(TokenType tokenType, Action<Scanner> matchDelegate) { return s => { matchDelegate(s); TokenType? result = null; if (s.sb.Length > 0) result = tokenType; return result; }; }