summaryrefslogtreecommitdiff
path: root/src/Language/Fiddle/Compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language/Fiddle/Compiler')
-rw-r--r--src/Language/Fiddle/Compiler/ConsistencyCheck.hs9
-rw-r--r--src/Language/Fiddle/Compiler/ImportResolution.hs8
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Language/Fiddle/Compiler/ConsistencyCheck.hs b/src/Language/Fiddle/Compiler/ConsistencyCheck.hs
index abfbb9b..e081122 100644
--- a/src/Language/Fiddle/Compiler/ConsistencyCheck.hs
+++ b/src/Language/Fiddle/Compiler/ConsistencyCheck.hs
@@ -142,7 +142,7 @@ instance AdvanceStage Expanded ImportStatement where
where
unitInterfaceScopeToGlobalScope =
fmap
- ( \(Annotated _ _ exportedValue) -> case exportedValue of
+ ( \(_, exportedValue) -> case exportedValue of
ExportedBitsType sz -> Left sz
ExportedObjType sz -> Right sz
)
@@ -597,7 +597,12 @@ insertIntoUnitInterface path ui (Commented comments srcspan) val =
)
in ui
{ rootScope =
- insertScope path (Annotated srcspan docComments val) (rootScope ui)
+ insertScope
+ path
+ ( Metadata srcspan docComments [],
+ val
+ )
+ (rootScope ui)
}
insertTypeSize ::
diff --git a/src/Language/Fiddle/Compiler/ImportResolution.hs b/src/Language/Fiddle/Compiler/ImportResolution.hs
index 4f076b8..aacf27e 100644
--- a/src/Language/Fiddle/Compiler/ImportResolution.hs
+++ b/src/Language/Fiddle/Compiler/ImportResolution.hs
@@ -218,8 +218,9 @@ getImportResolutionState parseFile compileToChecked flags unit = do
then doFullCompile
else return val
Left err -> do
- tell [Diagnostic Error err srcSpan]
- MaybeT $ return Nothing
+ tell [Diagnostic Warning "Doing recompile" srcSpan]
+ tell [Diagnostic Warning err srcSpan]
+ doFullCompile
else doFullCompile
addDependency path unitInterface =
@@ -254,7 +255,8 @@ getImportResolutionState parseFile compileToChecked flags unit = do
findFileInImportPath :: SourceSpan -> [FilePath] -> FilePath -> Compl FilePath
findFileInImportPath sourceSpan paths path = do
- realPaths <- lift2 $ filterM doesFileExist (map (++ ("/" ++ path)) paths)
+ canonicalPaths <- lift2 $ mapM (canonicalizePath . (++ ("/" ++ path))) paths
+ realPaths <- lift2 $ filterM doesFileExist canonicalPaths
case realPaths of
[] -> do