#[allow(dead_code)]
#[derive(ToDeriveInput, EnumDiscriminants)]
#[strum_discriminants(derive(EnumProperty, EnumString))]
-enum REPLCodePtr {
+enum ReplCodePtr {
#[strum_discriminants(strum(props(Arity = "4", Name = "$add_discontiguous_predicate")))]
AddDiscontiguousPredicate,
#[strum_discriminants(strum(props(Arity = "4", Name = "$add_dynamic_predicate")))]
#[strum_discriminants(strum(props(Arity = "2", Name = "$shell")))]
Shell,
#[strum_discriminants(strum(props(Arity = "1", Name = "$pid")))]
- PID,
+ Pid,
#[strum_discriminants(strum(props(Arity = "4", Name = "$chars_base64")))]
CharsBase64,
#[strum_discriminants(strum(props(Arity = "1", Name = "$devour_whitespace")))]
InferenceLimitExceeded,
#[strum_discriminants(strum(props(Arity = "1", Name = "$argv")))]
Argv,
- REPL(REPLCodePtr),
+ Repl(ReplCodePtr),
}
#[allow(dead_code)]
let system_clause_type: Type = parse_quote! { SystemClauseType };
let compare_term_type: Type = parse_quote! { CompareTerm };
let compare_number_type: Type = parse_quote! { CompareNumber };
- let repl_code_ptr_type: Type = parse_quote! { REPLCodePtr };
+ let repl_code_ptr_type: Type = parse_quote! { ReplCodePtr };
if ty == &clause_type {
Some(ClauseType::to_derive_input())
} else if ty == &compare_term_type {
Some(CompareTerm::to_derive_input())
} else if ty == &repl_code_ptr_type {
- Some(REPLCodePtr::to_derive_input())
+ Some(ReplCodePtr::to_derive_input())
} else {
None
}
}
/// `IndexingInstruction` cf. page 110 of wambook.
+ #[allow(clippy::enum_variant_names)]
#[derive(Clone, Debug)]
pub enum IndexingInstruction {
// The first index is the optimal argument being indexed.
&Instruction::CallSetEnv |
&Instruction::CallUnsetEnv |
&Instruction::CallShell |
- &Instruction::CallPID |
+ &Instruction::CallPid |
&Instruction::CallCharsBase64 |
&Instruction::CallDevourWhitespace |
&Instruction::CallIsSTOEnabled |
&Instruction::ExecuteSetEnv |
&Instruction::ExecuteUnsetEnv |
&Instruction::ExecuteShell |
- &Instruction::ExecutePID |
+ &Instruction::ExecutePid |
&Instruction::ExecuteCharsBase64 |
&Instruction::ExecuteDevourWhitespace |
&Instruction::ExecuteIsSTOEnabled |
let builtin_type_variants = attributeless_enum::<BuiltInClauseType>();
let inlined_type_variants = attributeless_enum::<InlinedClauseType>();
let system_clause_type_variants = attributeless_enum::<SystemClauseType>();
- let repl_code_ptr_variants = attributeless_enum::<REPLCodePtr>();
+ let repl_code_ptr_variants = attributeless_enum::<ReplCodePtr>();
let compare_number_variants = attributeless_enum::<CompareNumber>();
let compare_term_variants = attributeless_enum::<CompareTerm>();
clause_type_from_name_and_arity_arms.push(if !variant_fields.is_empty() {
quote! {
- (atom!(#name), #arity) => ClauseType::System(SystemClauseType::REPL(
- REPLCodePtr::#ident(#(#variant_fields),*)
+ (atom!(#name), #arity) => ClauseType::System(SystemClauseType::Repl(
+ ReplCodePtr::#ident(#(#variant_fields),*)
))
}
} else {
quote! {
- (atom!(#name), #arity) => ClauseType::System(SystemClauseType::REPL(
- REPLCodePtr::#ident
+ (atom!(#name), #arity) => ClauseType::System(SystemClauseType::Repl(
+ ReplCodePtr::#ident
))
}
});
clause_type_name_arms.push(if !variant_fields.is_empty() {
quote! {
ClauseType::System(
- SystemClauseType::REPL(REPLCodePtr::#ident(..))
+ SystemClauseType::Repl(ReplCodePtr::#ident(..))
) => atom!(#name)
}
} else {
quote! {
ClauseType::System(
- SystemClauseType::REPL(REPLCodePtr::#ident)
+ SystemClauseType::Repl(ReplCodePtr::#ident)
) => atom!(#name)
}
});
clause_type_to_instr_arms.push(if !variant_fields.is_empty() {
quote! {
- ClauseType::System(SystemClauseType::REPL(
- REPLCodePtr::#ident(#(#placeholder_ids),*)
+ ClauseType::System(SystemClauseType::Repl(
+ ReplCodePtr::#ident(#(#placeholder_ids),*)
)) => Instruction::#instr_ident(#(*#placeholder_ids),*)
}
} else {
quote! {
- ClauseType::System(SystemClauseType::REPL(
- REPLCodePtr::#ident
+ ClauseType::System(SystemClauseType::Repl(
+ ReplCodePtr::#ident
)) => Instruction::#instr_ident
}
});
quote! {
#preface_tokens
+ #[allow(clippy::enum_variant_names)]
#[derive(Clone, Debug)]
pub enum CompareTerm {
#(
)*
}
+ #[allow(clippy::enum_variant_names)]
#[derive(Clone, Copy, Debug)]
pub enum CompareNumber {
#(
}
#[derive(Clone, Debug)]
- pub enum REPLCodePtr {
+ pub enum ReplCodePtr {
#(
#repl_code_ptr_variants,
)*
}
}
- pub fn to_default(self) -> Instruction {
+ pub fn into_default(self) -> Instruction {
match self {
#(
#to_default_arms,
}
}
- pub fn to_execute(self) -> Instruction {
+ pub fn into_execute(self) -> Instruction {
match self {
#(
#to_execute_arms,
);
(name, arity, CountableInference::NotCounted)
- } else if id == "REPLCodePtr" {
- let (name, arity) = add_discriminant_data::<REPLCodePtrDiscriminants>(
+ } else if id == "ReplCodePtr" {
+ let (name, arity) = add_discriminant_data::<ReplCodePtrDiscriminants>(
&variant,
prefix,
&mut self.repl_code_ptr_variants,