Minus,
Plus,
Either,
+ Colon,
RequiresExpansionWithArgument(usize),
}
InnerMetaSpecs0 =.. [_ | InnerMetaSpecs],
HeadArg =.. [_ | InnerHeadArgs].
+inner_meta_specs((:), _, [], []) :-
+ !.
+
inner_meta_specs(N, HeadArg, InnerHeadArgs, InnerMetaSpecs) :-
integer(N),
N >= 0,
; ESG0 = _:_ ->
ESG = ESG0
; functor(ESG0, F, A0),
+ integer(MS),
A is A0 + MS,
functor(EESG0, F, A),
predicate_property(EESG0, built_in) ->
expand_meta_predicate_subgoals([SG | SGs], [MS | MSs], M, [ESG | ESGs], HeadVars) :-
( ( integer(MS),
MS >= 0
+ ; MS == (:)
) ->
( var(SG),
pairs:same_key(SG, HeadVars, [_|_], _) ->
MetaSpec::Minus => atom_as_cell!(atom!("+")),
MetaSpec::Plus => atom_as_cell!(atom!("-")),
MetaSpec::Either => atom_as_cell!(atom!("?")),
+ MetaSpec::Colon => atom_as_cell!(atom!(":")),
MetaSpec::RequiresExpansionWithArgument(ref arg_num) => {
fixnum_as_cell!(Fixnum::build_with(*arg_num as i64))
}
atom!("+") => MetaSpec::Plus,
atom!("-") => MetaSpec::Minus,
atom!("?") => MetaSpec::Either,
+ atom!(":") => MetaSpec::Colon,
_ => return Err(CompilationError::InvalidMetaPredicateDecl),
};