fix verify_attributes_stepper bug: proceed now considered a head instruction

This commit is contained in:
Mark Thom
2019-10-12 03:26:50 -06:00
parent 5893ff4231
commit 8c4c70b089
3 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "scryer-prolog"
version = "0.8.105"
version = "0.8.106"
authors = ["Mark Thom <markjordanthom@gmail.com>"]
build = "build.rs"
repository = "https://github.com/mthom/scryer-prolog"

View File

@@ -151,6 +151,7 @@ impl Line {
&Line::Cut(_) => true,
&Line::Fact(_) => true,
&Line::Query(_) => true,
&Line::Control(ControlInstruction::Proceed) => true,
_ => false,
}
}

View File

@@ -86,10 +86,13 @@ user:term_expansion(Term0, Terms) :-
nonvar(Term0),
Term0 = (:- attribute Atts),
nonvar(Atts),
phrase(put_attrs_var_check, Terms, Terms1),
phrase(put_attrs(Atts), Terms1, Terms2),
phrase(get_attrs_var_check, Terms2, Terms3),
phrase(get_attrs(Atts), Terms3).
phrase(expand_terms(Atts), Terms).
expand_terms(Atts) -->
put_attrs_var_check,
put_attrs(Atts),
get_attrs_var_check,
get_attrs(Atts).
put_attrs_var_check -->
{ numbervars([Var, Attr], 0, _) },
@@ -105,7 +108,7 @@ get_attrs_var_check -->
put_attrs(Name/Arity) -->
put_attr(Name, Arity),
{ numbervars([Var, Attr], 0, _) },
[(put_atts(Var, Attr) :- lists:maplist(put_atts(Var), Attr), !)].
[(put_atts(Var, Attr) :- lists:maplist(put_atts(Var), Attr))].
put_attrs((Name/Arity, Atts)) -->
{ nonvar(Atts) },
put_attr(Name, Arity),