correct inference counting over index backtracking, built-ins (#1977, #1987)

This commit is contained in:
Mark
2023-09-04 17:15:05 -06:00
parent 2ccc238119
commit 5585e83fd6
8 changed files with 153 additions and 102 deletions

View File

@@ -948,7 +948,9 @@ fn generate_instruction_preface() -> TokenStream {
#[derive(Clone, Copy, Debug)]
pub enum IndexedChoiceInstruction {
Retry(usize),
DefaultRetry(usize),
Trust(usize),
DefaultTrust(usize),
Try(usize),
}
@@ -958,6 +960,8 @@ fn generate_instruction_preface() -> TokenStream {
&IndexedChoiceInstruction::Retry(offset) => offset,
&IndexedChoiceInstruction::Trust(offset) => offset,
&IndexedChoiceInstruction::Try(offset) => offset,
&IndexedChoiceInstruction::DefaultRetry(offset) => offset,
&IndexedChoiceInstruction::DefaultTrust(offset) => offset,
}
}
@@ -972,6 +976,12 @@ fn generate_instruction_preface() -> TokenStream {
&IndexedChoiceInstruction::Retry(offset) => {
functor!(atom!("retry"), [fixnum(offset)])
}
&IndexedChoiceInstruction::DefaultTrust(offset) => {
functor!(atom!("default_trust"), [fixnum(offset)])
}
&IndexedChoiceInstruction::DefaultRetry(offset) => {
functor!(atom!("default_retry"), [fixnum(offset)])
}
}
}
}