use dupe::Dupe;
#[derive(Debug, Clone, Copy, Dupe, Eq, PartialEq, Hash)]
pub enum DialectTypes {
Disable,
ParseOnly,
Enable,
}
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub struct Dialect {
pub enable_def: bool,
pub enable_lambda: bool,
pub enable_load: bool,
pub enable_keyword_only_arguments: bool,
pub enable_positional_only_arguments: bool,
pub enable_types: DialectTypes,
pub enable_load_reexport: bool,
pub enable_top_level_stmt: bool,
pub enable_f_strings: bool,
pub _non_exhaustive: (),
}
impl Default for Dialect {
fn default() -> Dialect {
Dialect::Standard
}
}
#[allow(non_upper_case_globals)]
impl Dialect {
pub const Standard: Self = Self {
enable_def: true,
enable_lambda: true,
enable_load: true,
enable_keyword_only_arguments: false,
enable_positional_only_arguments: false,
enable_types: DialectTypes::Disable,
enable_load_reexport: true, enable_top_level_stmt: false,
enable_f_strings: false,
_non_exhaustive: (),
};
#[doc(hidden)]
pub const Extended: Self = Self {
enable_def: true,
enable_lambda: true,
enable_load: true,
enable_keyword_only_arguments: true,
enable_positional_only_arguments: false,
enable_types: DialectTypes::Enable,
enable_load_reexport: true,
enable_top_level_stmt: true,
enable_f_strings: false,
_non_exhaustive: (),
};
#[doc(hidden)]
pub const AllOptionsInternal: Self = Self {
enable_def: true,
enable_lambda: true,
enable_load: true,
enable_keyword_only_arguments: true,
enable_positional_only_arguments: true,
enable_types: DialectTypes::Enable,
enable_load_reexport: true,
enable_top_level_stmt: true,
enable_f_strings: true,
_non_exhaustive: (),
};
}