From ae11e8204080bc37eaf40bc3f53b94b999a02bc0 Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sat, 4 Aug 2018 14:56:38 -0600 Subject: [PATCH] fail on parse error invoked by read/1 --- src/prolog/ast.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/prolog/ast.rs b/src/prolog/ast.rs index 620a0ef7..b4f033cd 100644 --- a/src/prolog/ast.rs +++ b/src/prolog/ast.rs @@ -813,7 +813,7 @@ pub enum ClauseType { CallN, Inlined(InlinedClauseType), Named(ClauseName, CodeIndex), - Op(ClauseName, Fixity, CodeIndex), + Op(ClauseName, Fixity, CodeIndex), System(SystemClauseType) } @@ -862,7 +862,7 @@ impl ClauseName { &ClauseName::User(ref name) => name.as_ref() } } - + pub fn defrock_brackets(self) -> Self { fn defrock_brackets(s: &str) -> &str { if s.starts_with('(') && s.ends_with(')') { @@ -1019,7 +1019,7 @@ pub enum TermRef<'a> { Var(Level, &'a Cell, Rc) } -impl<'a> TermRef<'a> { +impl<'a> TermRef<'a> { pub fn level(self) -> Level { match self { TermRef::AnonVar(lvl) @@ -1600,7 +1600,10 @@ impl CodePtr { #[derive(Clone, PartialEq)] pub enum LocalCodePtr { DirEntry(usize, ClauseName), // offset, resident module name. - TopLevel(usize, usize) // chunk_num, offset. + TopLevel(usize, usize), // chunk_num, offset. + // DynamicModuleCall(ClauseName, ClauseName, usize) + // module name, predicate name and arity. + // used for internal, dynamic module calls. } impl LocalCodePtr { -- 2.54.0