# Buggy code
def __init__(self, config=None):
    self.config = config or default_config
    self.matcher = RepeatedMultiMatcher(
        RegexMatcher.from_shorthand("whitespace", r"[\t ]*"),
        RegexMatcher.from_shorthand(
            "inline_comment", r"(-- |#)[^\n]*", is_comment=True
        ),
        RegexMatcher.from_shorthand(
            "block_comment", r"\/\*([^\*]|\*[^\/])*\*\/", is_comment=True
        ),
        RegexMatcher.from_shorthand("single_quote", r"'[^']*'", is_code=True),
        RegexMatcher.from_shorthand("double_quote", r'"[^"]*"', is_code=True),
        RegexMatcher.from_shorthand("back_quote", r"`[^`]*`", is_code=True),
        RegexMatcher.from_shorthand(
            "numeric_literal", r"(-?[0-9]+(\.[0-9]+)?)", is_code=True
        ),
        RegexMatcher.from_shorthand("greater_than_or_equal", r">=", is_code=True),
        RegexMatcher.from_shorthand("less_than_or_equal", r"<=", is_code=True),
        RegexMatcher.from_shorthand("newline", r"\r\n"),
        RegexMatcher.from_shorthand("casting_operator", r"::"),
        RegexMatcher.from_shorthand("not_equals", r"!="),
        SingletonMatcher.from_shorthand("newline", "\n"),
        SingletonMatcher.from_shorthand("equals", "=", is_code=True),
        SingletonMatcher.from_shorthand("greater_than", ">", is_code=True),
        SingletonMatcher.from_shorthand("less_than", "<", is_code=True),
        SingletonMatcher.from_shorthand("dot", ".", is_code=True),
        SingletonMatcher.from_shorthand("comma", ",", is_code=True),
        SingletonMatcher.from_shorthand("plus", "+", is_code=True),
        SingletonMatcher.from_shorthand("minus", "-", is_code=True),
        SingletonMatcher.from_shorthand("divide", "/", is_code=True),
        SingletonMatcher.from_shorthand("star", "*", is_code=True),
        SingletonMatcher.from_shorthand("bracket_open", "(", is_code=True),
        SingletonMatcher.from_shorthand("bracket_close", ")", is_code=True),
        SingletonMatcher.from_shorthand("semicolon", ";", is_code=True),
        RegexMatcher.from_shorthand("code", r"[0-9a-zA-Z_]*", is_code=True),
    )


# Traceback (TypeError)
Traceback (most recent call last):
File "/home/user/sql/.venv/bin/sqlfluff", line 11, in <module>
load_entry_point('sqlfluff==0.1.3', 'console_scripts', 'sqlfluff')()
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/user/sql/.venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/cli/commands.py", line 85, in lint
result = lnt.lint_paths(paths, verbosity=verbose)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/linter.py", line 324, in lint_paths
result.add(self.lint_path(path, verbosity=verbosity, fix=fix))
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/linter.py", line 312, in lint_path
linted_path.add(self.lint_file(f, fname=fname, verbosity=verbosity, fix=fix))
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/linter.py", line 212, in lint_file
parsed, vs, time_dict = self.parse_file(f=f, fname=fname, verbosity=verbosity)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/linter.py", line 193, in parse_file
parsed = fs.parse(recurse=recurse, verbosity=verbosity, dialect=self.dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 228, in parse
verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 394, in expand
res = stmt.parse(recurse=recurse, parse_depth=parse_depth, verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 228, in parse
verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 394, in expand
res = stmt.parse(recurse=recurse, parse_depth=parse_depth, verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 228, in parse
verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 394, in expand
res = stmt.parse(recurse=recurse, parse_depth=parse_depth, verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 228, in parse
verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 394, in expand
res = stmt.parse(recurse=recurse, parse_depth=parse_depth, verbosity=verbosity, dialect=dialect)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 186, in parse
dialect=dialect, match_segment=self.__class__.__name__)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 70, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 273, in match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 70, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 485, in match
match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 70, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 273, in match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 70, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 236, in match
dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 361, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/segments_base.py", line 320, in match
dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 70, in _match
verbosity=verbosity, dialect=dialect, match_segment=match_segment)
File "/home/user/sql/.venv/lib/python3.7/site-packages/sqlfluff/parser/grammar.py", line 586, in match
segment=segments[start_bracket_idx])
TypeError: tuple indices must be integers or slices, not NoneType

# Fixed code
def __init__(self, config=None):
    self.config = config or default_config
    self.matcher = RepeatedMultiMatcher(
        RegexMatcher.from_shorthand("whitespace", r"[\t ]*"),
        RegexMatcher.from_shorthand(
            "inline_comment", r"(-- |#)[^\n]*", is_comment=True
        ),
        RegexMatcher.from_shorthand(
            "block_comment", r"\/\*([^\*]|\*[^\/])*\*\/", is_comment=True
        ),
        RegexMatcher.from_shorthand("single_quote", r"'[^']*'", is_code=True),
        RegexMatcher.from_shorthand("double_quote", r'"[^"]*"', is_code=True),
        RegexMatcher.from_shorthand("back_quote", r"`[^`]*`", is_code=True),
        RegexMatcher.from_shorthand(
            "numeric_literal", r"(-?[0-9]+(\.[0-9]+)?)", is_code=True
        ),
        RegexMatcher.from_shorthand("greater_than_or_equal", r">=", is_code=True),
        RegexMatcher.from_shorthand("less_than_or_equal", r"<=", is_code=True),
        RegexMatcher.from_shorthand("newline", r"\r\n"),
        RegexMatcher.from_shorthand("casting_operator", r"::"),
        RegexMatcher.from_shorthand("not_equals", r"!="),
        SingletonMatcher.from_shorthand("newline", "\n"),
        SingletonMatcher.from_shorthand("equals", "=", is_code=True),
        SingletonMatcher.from_shorthand("greater_than", ">", is_code=True),
        SingletonMatcher.from_shorthand("less_than", "<", is_code=True),
        SingletonMatcher.from_shorthand("dot", ".", is_code=True),
        SingletonMatcher.from_shorthand("comma", ",", is_code=True),
        SingletonMatcher.from_shorthand("plus", "+", is_code=True),
        SingletonMatcher.from_shorthand("tilde", "~", is_code=True),
        SingletonMatcher.from_shorthand("minus", "-", is_code=True),
        SingletonMatcher.from_shorthand("divide", "/", is_code=True),
        SingletonMatcher.from_shorthand("star", "*", is_code=True),
        SingletonMatcher.from_shorthand("bracket_open", "(", is_code=True),
        SingletonMatcher.from_shorthand("bracket_close", ")", is_code=True),
        SingletonMatcher.from_shorthand("semicolon", ";", is_code=True),
        RegexMatcher.from_shorthand("code", r"[0-9a-zA-Z_]*", is_code=True),
    )