From: Mark Thom Date: Sat, 4 Aug 2018 20:56:38 +0000 (-0600) Subject: fail on parse error invoked by read/1 X-Git-Tag: v0.8.110~437 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=ae11e8204080bc37eaf40bc3f53b94b999a02bc0;p=scryer-prolog.git fail on parse error invoked by read/1 --- 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 {