ruff/crates/ruff_python_parser/resources/inline/err
Dylan c5b58187da
Add syntax error when conversion flag does not immediately follow exclamation mark (#18706)
Closes #18671

Note that while this has, I believe, always been invalid syntax, it was
reported as a different syntax error until Python 3.12:

Python 3.11:

```pycon
>>> x = 1
>>> f"{x! s}"
  File "<stdin>", line 1
    f"{x! s}"
             ^
SyntaxError: f-string: invalid conversion character: expected 's', 'r', or 'a'
```

Python 3.12:

```pycon
>>> x = 1
>>> f"{x! s}"
  File "<stdin>", line 1
    f"{x! s}"
        ^^^
SyntaxError: f-string: conversion type must come right after the exclamanation mark
```
2025-06-16 11:44:42 -05:00
..
ann_assign_stmt_invalid_annotation.py
ann_assign_stmt_invalid_target.py
ann_assign_stmt_invalid_value.py
ann_assign_stmt_missing_rhs.py
ann_assign_stmt_type_alias_annotation.py
args_unparenthesized_generator.py
assert_empty_msg.py
assert_empty_test.py
assert_invalid_msg_expr.py
assert_invalid_test_expr.py
assign_stmt_invalid_target.py
assign_stmt_invalid_value_expr.py
assign_stmt_keyword_target.py
assign_stmt_missing_rhs.py
assign_stmt_starred_expr_value.py
async_unexpected_token.py
aug_assign_stmt_invalid_target.py
aug_assign_stmt_invalid_value.py
aug_assign_stmt_missing_rhs.py
case_expect_indented_block.py
class_def_empty_body.py
class_def_missing_name.py
class_def_unclosed_type_param_list.py
class_type_params_py311.py
clause_expect_indented_block.py
clause_expect_single_statement.py
comma_separated_missing_comma.py
comma_separated_missing_comma_between_elements.py
comma_separated_missing_element_between_commas.py
comma_separated_missing_first_element.py
comprehension_missing_for_after_async.py
debug_shadow_class.py
debug_shadow_function.py
debug_shadow_import.py
debug_shadow_match.py
debug_shadow_try.py
debug_shadow_type_alias.py
debug_shadow_with.py
decorator_await_expression_py38.py
decorator_dict_literal_py38.py
decorator_expression_py38.py
decorator_float_literal_py38.py
decorator_invalid_expression.py
decorator_missing_expression.py
decorator_missing_newline.py
decorator_named_expression_py37.py
decorator_non_toplevel_call_expression_py38.py
decorator_unexpected_token.py
del_debug_py39.py
del_incomplete_target.py
del_stmt_empty.py
dotted_name_multiple_dots.py
duplicate_match_class_attr.py
duplicate_match_key.py
duplicate_type_parameter_names.py
except_star_py310.py
except_stmt_invalid_expression.py
except_stmt_missing_as_name.py
except_stmt_missing_exception.py
except_stmt_missing_exception_and_as_name.py
except_stmt_unparenthesized_tuple_as.py
except_stmt_unparenthesized_tuple_no_as_py313.py
f_string_conversion_follows_exclamation.py
f_string_empty_expression.py
f_string_invalid_conversion_flag_name_tok.py
f_string_invalid_conversion_flag_other_tok.py
f_string_invalid_starred_expr.py
f_string_lambda_without_parentheses.py
f_string_unclosed_lbrace.py
f_string_unclosed_lbrace_in_format_spec.py
for_iter_unpack_py38.py
for_stmt_invalid_iter_expr.py
for_stmt_invalid_target.py
for_stmt_invalid_target_binary_expr.py
for_stmt_invalid_target_in_keyword.py
for_stmt_missing_in_keyword.py
for_stmt_missing_iter.py
for_stmt_missing_target.py
from_import_dotted_names.py
from_import_empty_names.py
from_import_missing_module.py
from_import_missing_rpar.py
from_import_star_with_other_names.py
from_import_unparenthesized_trailing_comma.py
function_def_empty_body.py
function_def_invalid_return_expr.py
function_def_missing_identifier.py
function_def_missing_return_type.py
function_def_unclosed_parameter_list.py
function_def_unclosed_type_param_list.py
function_def_unparenthesized_return_types.py
function_type_params_py311.py
global_stmt_empty.py
global_stmt_expression.py
global_stmt_trailing_comma.py
if_stmt_elif_missing_colon.py
if_stmt_empty_body.py
if_stmt_invalid_elif_test_expr.py
if_stmt_invalid_test_expr.py
if_stmt_missing_colon.py
if_stmt_missing_test.py
if_stmt_misspelled_elif.py
implicitly_concatenated_unterminated_string.py
implicitly_concatenated_unterminated_string_multiline.py
import_alias_missing_asname.py
import_stmt_empty.py
import_stmt_parenthesized_names.py
import_stmt_star_import.py
import_stmt_trailing_comma.py
invalid_annotation_class.py
invalid_annotation_function.py
invalid_annotation_function_py314.py
invalid_annotation_py314.py
invalid_annotation_type_alias.py
invalid_byte_literal.py
invalid_del_target.py
invalid_fstring_literal_element.py
invalid_string_literal.py
irrefutable_case_pattern.py
iter_unpack_return_py37.py
iter_unpack_yield_py37.py
lambda_body_with_starred_expr.py
lambda_body_with_yield_expr.py
match_before_py310.py
match_classify_as_keyword.py
match_classify_as_keyword_or_identifier.py
match_expected_colon.py
match_stmt_expect_indented_block.py
match_stmt_expected_case_block.py
match_stmt_invalid_guard_expr.py
match_stmt_invalid_subject_expr.py
match_stmt_missing_guard_expr.py
match_stmt_missing_pattern.py
match_stmt_no_newline_before_case.py
match_stmt_single_starred_subject.py
mixed_bytes_and_non_bytes_literals.py
multiple_assignment_in_case_pattern.py
multiple_clauses_on_same_line.py
named_expr_slice.py
named_expr_slice_parse_error.py
nested_async_comprehension_py310.py
node_range_with_gaps.py
nonlocal_declaration_at_module_level.py
nonlocal_stmt_empty.py
nonlocal_stmt_expression.py
nonlocal_stmt_trailing_comma.py
param_missing_annotation.py
param_missing_default.py
param_with_invalid_annotation.py
param_with_invalid_default.py
param_with_invalid_star_annotation.py
param_with_star_annotation_py310.py
params_duplicate_names.py
params_expected_after_star_separator.py
params_kwarg_after_star_separator.py
params_multiple_kwargs.py
params_multiple_slash_separator.py
params_multiple_star_separator.py
params_multiple_varargs.py
params_no_arg_before_slash.py
params_non_default_after_default.py
params_star_after_slash.py
params_star_separator_after_star_param.py
params_var_keyword_with_default.py
params_var_positional_with_default.py
parenthesized_context_manager_py38.py
parenthesized_kwarg_py38.py
pep701_f_string_py311.py
pos_only_py37.py
raise_stmt_from_without_exc.py
raise_stmt_invalid_cause.py
raise_stmt_invalid_exc.py
raise_stmt_unparenthesized_tuple_cause.py
raise_stmt_unparenthesized_tuple_exc.py
rebound_comprehension_variable.py
return_stmt_invalid_expr.py
simple_and_compound_stmt_on_same_line.py
simple_and_compound_stmt_on_same_line_in_block.py
simple_stmts_on_same_line.py
simple_stmts_on_same_line_in_block.py
single_star_for.py
single_star_return.py
single_star_yield.py
single_starred_assignment_target.py
star_index_py310.py
star_slices.py
t_string_empty_expression.py
t_string_invalid_conversion_flag_name_tok.py
t_string_invalid_conversion_flag_other_tok.py
t_string_invalid_starred_expr.py
t_string_lambda_without_parentheses.py
t_string_unclosed_lbrace.py
t_string_unclosed_lbrace_in_format_spec.py
template_strings_py313.py
try_stmt_invalid_order.py
try_stmt_missing_except_finally.py
try_stmt_misspelled_except.py
try_stmt_mixed_except_kind.py
tuple_context_manager_py38.py
type_alias_incomplete_stmt.py
type_alias_invalid_value_expr.py
type_param_default_py312.py
type_param_invalid_bound_expr.py
type_param_missing_bound.py
type_param_param_spec_bound.py
type_param_param_spec_invalid_default_expr.py
type_param_param_spec_missing_default.py
type_param_type_var_invalid_default_expr.py
type_param_type_var_missing_default.py
type_param_type_var_tuple_bound.py
type_param_type_var_tuple_invalid_default_expr.py
type_param_type_var_tuple_missing_default.py
type_params_empty.py
type_stmt_py311.py
unparenthesized_named_expr_index_py38.py
unparenthesized_named_expr_set_comp_py38.py
unparenthesized_named_expr_set_literal_py38.py
unterminated_fstring_newline_recovery.py
walrus_py37.py
while_stmt_invalid_test_expr.py
while_stmt_missing_colon.py
while_stmt_missing_test.py
with_items_parenthesized_missing_colon.py
with_items_parenthesized_missing_comma.py
write_to_debug_expr.py