Commit 72e53eef authored by Diederik van Arkel's avatar Diederik van Arkel

Haskell frontend support

parent 88c4b0d7
......@@ -945,6 +945,8 @@ compiling_info_async current
UpdateDependencies :: !Bool !String !(List String) !DriverCompilingInfo !*DirCache !DriverStateRecord !*(PSt *General)
-> (*(PSt *General),*DirCache,Bool,Bool,List String,DriverCompilingInfo,DriverStateRecord,Bool)
UpdateDependencies force next rest compinfo dircache ds ps`
# impname = MakeImpPathname next
# (version,ps) = getCurrentVers ps // lift to DriverState
# (cinf,compinfo) = compiling_info compinfo
# line = Level2 ((if verbose ("Analyzing \'" +++ modname +++ "\'. ") ("")) +++ cinf)
......@@ -1076,7 +1078,6 @@ where
impeo = {pos_size = DefWindowPos_and_Size, eo = eo}
modname = GetModuleName next
impname = MakeImpPathname next
modinfo = PR_GetModuleInfo modname project
co = case modinfo of
Just modinfo -> modinfo.compilerOptions
......@@ -1328,22 +1329,27 @@ check_dependant_dates modname abcpath mods xxx_md xxx_dd dircache
| isNothing xxx_md
= (False,"["+++modname+++".icl,]: has no date",dircache)
# xxx_md = fromJust xxx_md
# (ok,_,yyy_md,dircache) = DC_Search (RemovePath (MakeImpPathname abcpath)) dircache
// # (ok,_,yyy_md,dircache) = DC_Search (RemovePath (MakeImpPathname abcpath)) dircache
// | not ok
// = (False,"["+++modname+++".icl,]: not found in cached paths",dircache)
# (ok,ext,yyy_md,dircache) = findimp abcpath dircache
| not ok
= (False,"["+++modname+++".icl,]: not found in cached paths",dircache)
= (False,"["+++modname+++ext+++",]: not found in cached paths",dircache)
| not (eqDate xxx_md yyy_md)
= (False,"["+++modname+++".icl,]: .icl has changed",dircache)
= moretricks mods xxx_dd dircache
= (False,"["+++modname+++ext+++",]: module has changed",dircache)
= moretricks ext mods xxx_dd dircache
where
moretricks Nil Nil dircache = (True,"Fine!",dircache)
moretricks Nil _ dircache = (False,"["+++modname+++".icl,]: more stored dates than modules??",dircache)
moretricks _ Nil dircache = (False,"["+++modname+++".icl,]: more stored modules than dates??",dircache)
moretricks (md:!ms) (dt:!ds) dc
# (ok,_,depdate,dc) = DC_Search (MakeDefPathname md) dc
| not ok = (False,"["+++modname+++".icl,]: can`t find "+++md+++" in cached paths",dc)
| not (eqDate depdate dt) = (False,"["+++modname+++".icl,]: "+++md+++" has changed",dc)
= moretricks ms ds dc
moretricks _ _ _ = abort "driver.icl: Fooling Clean warnings"
moretricks _ Nil Nil dircache = (True,"Fine!",dircache)
moretricks _ Nil _ dircache = (False,"["+++modname+++".icl,]: more stored dates than modules??",dircache)
moretricks _ _ Nil dircache = (False,"["+++modname+++".icl,]: more stored modules than dates??",dircache)
moretricks ext (md:!ms) (dt:!ds) dc
// # (ok,_,depdate,dc) = DC_Search (MakeDefPathname md) dc
// | not ok = (False,"["+++modname+++".icl,]: can`t find "+++md+++" in cached paths",dc)
# (ok,_,_,depdate,dc) = finddef md dc
| not ok = (False,"["+++modname+++ext+++",]: can`t find "+++md+++" in cached paths",dc)
| not (eqDate depdate dt) = (False,"["+++modname+++ext+++",]: "+++md+++" has changed",dc)
= moretricks ext ms ds dc
moretricks _ _ _ _ = abort "driver.icl: Fooling Clean warnings"
eqDate (ld,lt) (rd,rt)
| lt.seconds` <> rt.seconds` = False
......@@ -1528,27 +1534,52 @@ LookupModulePaths :: !(List .String) !*DirCache -> (Bool,.List Pathname,*DirCach
LookupModulePaths Nil dc
= (True,Nil,dc)
LookupModulePaths (mn :! ms) dc
# mn = MakeDefPathname mn
# (ok,pt,_,dc) = DC_Search mn dc
// # mn = MakeDefPathname mn
// # (ok,pt,_,dc) = DC_Search mn dc
# (ok,ext,pt,_,dc) = finddef mn dc
| not ok
// # dc = trace_n ("LookupModulePaths: couldn't find: "+++mn) dc
// = LookupModulePaths ms dc
= (False, mn :! Nil, dc)
# (ok,ps,dc) = LookupModulePaths ms dc
| not ok
= (ok, ps, dc)
= (ok,MakeFullPathname pt mn :! ps, dc)
= (ok,MakeFullPathname pt (RemoveSuffix mn +++ ext) :! ps, dc)
//LookupModulePaths` :: !(List .String) !(List .String) !*DirCache -> (Bool,.List Pathname,.List DateTime,*DirCache);
LookupModulePaths` Nil acc dc
= (True,Nil,dc)
LookupModulePaths` (mn :! ms) acc dc
# mn = MakeDefPathname mn
# (ok,pt,_,dc) = DC_Search mn dc
// # mn = MakeDefPathname mn
// # (ok,pt,_,dc) = DC_Search mn dc
# (ok,ext,pt,_,dc) = finddef mn dc
| not ok
= (False, mn :! acc, dc)
= LookupModulePaths` ms (MakeFullPathname pt mn :! acc) dc
= LookupModulePaths` ms (MakeFullPathname pt (RemoveSuffix mn +++ ext) :! acc) dc
findimp path dircache
# short = RemovePath (RemoveSuffix path)
# (ok,_,yyy_md,dircache) = DC_Search (short +++ ".icl") dircache
| ok
= (ok,".icl",yyy_md,dircache)
# (ok,_,yyy_md,dircache) = DC_Search (short +++ ".hs") dircache
| ok
= (ok,".hs",yyy_md,dircache)
# (ok,_,yyy_md,dircache) = DC_Search (short +++ ".lhs") dircache
| ok
= (ok,".lhs",yyy_md,dircache)
= (ok,".icl",yyy_md,dircache)
finddef path dircache
# short = RemovePath (RemoveSuffix path)
# (ok,pt,yyy_md,dircache) = DC_Search (short +++ ".dcl") dircache
| ok
= (ok,".dcl",pt,yyy_md,dircache)
# (ok,pt,yyy_md,dircache) = DC_Search (short +++ ".hs") dircache
| ok
= (ok,".hs",pt,yyy_md,dircache)
# (ok,pt,yyy_md,dircache) = DC_Search (short +++ ".lhs") dircache
| ok
= (ok,".lhs",pt,yyy_md,dircache)
= (ok,".dcl",pt,yyy_md,dircache)
//-- Handle DirCache Setup Errors...
HandleDCErrors :: !Bool ![String] ![Warn] !*(PSt *General) -> *(PSt *General)
......
......@@ -42,7 +42,7 @@ RemoveSuffix path
(found, position) = FindLastChar '.' path last;
suf = path % (position, last);
// suffix = suf == ".dcl" || suf == ".icl" || suf == ".abc" || suf == ".o" || suf == ".obj" || suf == ".prj";
suffix = isMember suf [".",".dcl",".icl",".abc",".o",".obj",".obj0",".obj1",".obj2",".xo",".cxo",".prj"];
suffix = isMember suf [".",".dcl",".icl",".hs",".lhs",".abc",".o",".obj",".obj0",".obj1",".obj2",".xo",".cxo",".prj"];
last = dec (size path);
RemoveSuffix` :: !Pathname -> String;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment