

@classmethod
def BuildMatchers(cls):
    'Builds the token matcher group.\n\n    The token matcher groups work as follows: it is a list of Matcher objects.\n    The matchers will be tried in this order, and the first to match will be\n    returned.  Hence the order is important because the matchers that come first\n    overrule the matchers that come later.\n\n    Returns:\n      The completed token matcher group.\n    '
    keyword = re.compile(('(%s)((?=[^%s])|$)' % ('|'.join(cls.KEYWORD_LIST), cls.IDENTIFIER_CHAR)))
    return {
        JavaScriptModes.TEXT_MODE: [Matcher(cls.START_DOC_COMMENT, Type.START_DOC_COMMENT, JavaScriptModes.DOC_COMMENT_MODE), Matcher(cls.START_BLOCK_COMMENT, Type.START_BLOCK_COMMENT, JavaScriptModes.BLOCK_COMMENT_MODE), Matcher(cls.END_OF_LINE_SINGLE_LINE_COMMENT, Type.START_SINGLE_LINE_COMMENT), Matcher(cls.START_SINGLE_LINE_COMMENT, Type.START_SINGLE_LINE_COMMENT, JavaScriptModes.LINE_COMMENT_MODE), Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_START, JavaScriptModes.SINGLE_QUOTE_STRING_MODE), Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_START, JavaScriptModes.DOUBLE_QUOTE_STRING_MODE), Matcher(keyword.REGEX, Type.REGEX), Matcher(cls.START_BLOCK, Type.START_BLOCK), Matcher(cls.END_BLOCK, Type.END_BLOCK), Matcher(cls.FUNCTION_DECLARATION, Type.FUNCTION_DECLARATION, JavaScriptModes.FUNCTION_MODE), Matcher(cls.OPENING_PAREN, Type.START_PAREN), Matcher(cls.CLOSING_PAREN, Type.END_PAREN), Matcher(cls.OPENING_BRACKET, Type.START_BRACKET), Matcher(cls.CLOSING_BRACKET, Type.END_BRACKET), Matcher(cls.NUMBER, Type.NUMBER), Matcher(cls.SIMPLE_LVALUE, Type.SIMPLE_LVALUE), Matcher(cls.OPERATOR, Type.OPERATOR), Matcher(keyword, Type.KEYWORD), Matcher(cls.WHITESPACE, Type.WHITESPACE), Matcher(cls.IDENTIFIER, Type.IDENTIFIER), Matcher(cls.SEMICOLON, Type.SEMICOLON)],
        JavaScriptModes.SINGLE_QUOTE_STRING_MODE: [Matcher(cls.SINGLE_QUOTE_TEXT, Type.STRING_TEXT), Matcher(cls.SINGLE_QUOTE, Type.SINGLE_QUOTE_STRING_END, JavaScriptModes.TEXT_MODE)],
        JavaScriptModes.DOUBLE_QUOTE_STRING_MODE: [Matcher(cls.DOUBLE_QUOTE_TEXT, Type.STRING_TEXT), Matcher(cls.DOUBLE_QUOTE, Type.DOUBLE_QUOTE_STRING_END, JavaScriptModes.TEXT_MODE)],
        JavaScriptModes.BLOCK_COMMENT_MODE: [Matcher(cls.END_BLOCK_COMMENT, Type.END_BLOCK_COMMENT, JavaScriptModes.TEXT_MODE), Matcher(cls.BLOCK_COMMENT_TEXT, Type.COMMENT)],
        JavaScriptModes.DOC_COMMENT_MODE: (cls.COMMON_DOC_MATCHERS + [Matcher(cls.DOC_COMMENT_TEXT, Type.COMMENT)]),
        JavaScriptModes.DOC_COMMENT_LEX_SPACES_MODE: (cls.COMMON_DOC_MATCHERS + [Matcher(cls.WHITESPACE, Type.COMMENT), Matcher(cls.DOC_COMMENT_NO_SPACES_TEXT, Type.COMMENT)]),
        JavaScriptModes.LINE_COMMENT_MODE: [Matcher(cls.ANYTHING, Type.COMMENT, JavaScriptModes.TEXT_MODE)],
        JavaScriptModes.FUNCTION_MODE: [Matcher(cls.OPENING_PAREN, Type.START_PARAMETERS, JavaScriptModes.PARAMETER_MODE), Matcher(cls.WHITESPACE, Type.WHITESPACE), Matcher(cls.IDENTIFIER, Type.FUNCTION_NAME)],
        JavaScriptModes.PARAMETER_MODE: [Matcher(cls.CLOSING_PAREN_WITH_SPACE, Type.END_PARAMETERS, JavaScriptModes.TEXT_MODE), Matcher(cls.PARAMETERS, Type.PARAMETERS, JavaScriptModes.PARAMETER_MODE)],
    }

dataset/ETHPy150Open google/closure-linter/closure_linter/javascripttokenizer.py JavaScriptTokenizer.BuildMatchers/VarMisuse@137/391 `cls`->`keyword`