From 0d52bcf663ead766ae83c8f30f90beaea5790789 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 26 Feb 2023 18:10:10 +0100 Subject: semicolon colons semi --- app/Builtins.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/Builtins.hs') diff --git a/app/Builtins.hs b/app/Builtins.hs index c63fb25..b38eaf0 100644 --- a/app/Builtins.hs +++ b/app/Builtins.hs @@ -104,12 +104,13 @@ assertRule addClause = scope <- use (cur . hvar) heap <- use (cur . heap) comma <- findAtom "," + semi <- findAtom ";" cut <- findAtom "!" case Co.squashVars . IR.CallI 0 <$> traverse (Co.heapStructPrlgInt Nothing heap) args of Just (IR.CallI 0 [hs, gs]) -> let (U (Struct s):cs) = - Co.compileGoal hs ++ Co.seqGoals (Co.compileGoals comma cut gs) + Co.compileGoal hs ++ Co.compileGoals comma semi cut gs in do addClause cs s continue _ -> prlgError "assert clause failure" @@ -131,10 +132,11 @@ exec' fgol = case Co.squashVars <$> Co.heapStructPrlgInt Nothing heap arg of Just gs -> do comma <- findAtom "," + semi <- findAtom ";" cut <- findAtom "!" zoom cur $ do hvar .= M.empty - hed .= Co.seqGoals (Co.compileGoals comma cut gs) + hed .= Co.compileGoals comma semi cut gs gol %= fgol continue _ -> prlgError "bad goal" @@ -356,6 +358,7 @@ addPrelude = do addProc [[U (LocalRef 0), U (LocalRef 0), Done]] "=" 2 {- clauses -} addOp $ O.xfy "," 1000 + addOp $ O.xfy ";" 1100 addOp $ O.xfx ":-" 1200 addOp $ O.fx ":-" 1200 horn1 <- findStruct ":-" 1 -- cgit v1.2.3