def parse_constant(parser: TokenParser) -> MatcherSdv: return parser.consume_mandatory_constant_string_that_must_be_unquoted_and_equal( logic.BOOLEANS_STRINGS.keys(), _make_constant_matcher, )
def _parse_phase_spec_option_argument(token_parser: TokenParser) -> FrozenSet[_impl.Phase]: return token_parser.consume_mandatory_constant_string_that_must_be_unquoted_and_equal( _SET_SPEC_ARGUMENTS, _SET_SPEC_ARGUMENT_2_SPEC.get, _INVALID_PHASE_SPEC_ARGUMENT__ERR_MSG, )
def _file_type(self, token_parser: TokenParser) -> str: return token_parser.consume_mandatory_constant_string_that_must_be_unquoted_and_equal( self._file_type_tokens, functional.identity, syntax.FILE_TYPE_SE_STR, )
def _parse_type_matcher(parser: TokenParser) -> FileMatcherSdv: file_type = parser.consume_mandatory_constant_string_that_must_be_unquoted_and_equal( file_properties.SYNTAX_TOKEN_2_FILE_TYPE, file_properties.SYNTAX_TOKEN_2_FILE_TYPE.get, TYPE_MATCHER_ARGUMENT.name) return sdv_components.matcher_sdv_from_constant_primitive(FileMatcherType(file_type))
def _parse_type_matcher(parser: TokenParser) -> FileMatcherResolver: file_type = parser.consume_mandatory_constant_string_that_must_be_unquoted_and_equal( file_properties.SYNTAX_TOKEN_2_FILE_TYPE, file_properties.SYNTAX_TOKEN_2_FILE_TYPE.get, '{_TYPE_}') return _constant(file_matchers.FileMatcherType(file_type))