Skip to content

Commit a1ae66e

Browse files
committed
add missing file.
1 parent bc39f83 commit a1ae66e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Graphics/Implicit/ExtOpenScad/Eval/Module.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ module Graphics.Implicit.ExtOpenScad.Eval.Module (
1414
runModule,
1515
) where
1616

17-
import Prelude(Maybe(Just, Nothing), Bool(False), (>), (.), ($), elem, error, filter, fmap, fst, init, last, length, not, notElem, null, show, snd, pure, zip, (<>), (&&), (==), (/=), String, (<$>))
17+
import Prelude(Maybe(Just, Nothing), Bool(False), (.), ($), elem, error, filter, fmap, fst, init, last, length, not, notElem, null, show, snd, pure, zip, (<>), (&&), (==), (/=), String, (<$>))
1818

1919
import Graphics.Implicit.ExtOpenScad.Definitions (
20-
Expr(LitE),
2120
OVal(OUModule, ONModule, ONModuleWithSuite, OVargsModule),
2221
SourcePosition,
2322
StateC,
2423
StatementI,
2524
Symbol(Symbol)
2625
)
2726

28-
import Graphics.Implicit.ExtOpenScad.Util.StateC (errorC, warnC)
27+
import Graphics.Implicit.ExtOpenScad.Util.StateC (errorC)
2928

3029
import qualified Data.List as DL (intercalate)
3130

@@ -111,6 +110,8 @@ checkInstances :: SourcePosition -> OVal -> [(Maybe Symbol, Expr)] -> [[(Symbol,
111110
checkInstances sourcePos mod argsExpr forms = do
112111
possibleInstances <- selectInstances forms argsExpr sourcePos
113112
when (null possibleInstances) (errorC sourcePos $ "No instance of " <> nameOfModule mod <> " found to match given parameters.\narguments given:\n" <> pack (show argsExpr) <> "\nForms available:" <> pack (show forms) <> "\n")
113+
-- FIXME: make this a warning that can be turned on and off, and is off by default.
114+
{-
114115
when (length possibleInstances > 1) (warnC sourcePos $ "Multiple instances of " <> nameOfModule mod <> " found matching given parameters.\nInstances found:\n" <> (DTL.concat $ showInstance mod <$> possibleInstances) <> "Parameters given: " <> nameOfModule mod <> "(" <> (DTL.intercalate ", " $ showParameter <$> argsExpr) <> ");")
115116
where
116117
showParameter :: (Maybe Symbol, Expr) -> Text
@@ -121,6 +122,7 @@ checkInstances sourcePos mod argsExpr forms = do
121122
showInstance myMod args = nameOfModule myMod <> "(" <> (DTL.intercalate "," $ showArg <$> args) <> ");\n"
122123
showArg :: (Symbol, Bool) -> Text
123124
showArg (Symbol argName, optional) = argName <> "=...(" <> (if optional then "optional)" else "required)")
125+
-}
124126

125127
-- Run a module.
126128
runModule :: SourcePosition -> (Maybe (StateC [OVal]), [String]) -> StateC [OVal]

0 commit comments

Comments
 (0)