summaryrefslogtreecommitdiff
path: root/src/mod_db.sml
diff options
context:
space:
mode:
authorGravatar FrigoEU <simon.van.casteren@gmail.com>2019-07-31 15:13:18 +0200
committerGravatar FrigoEU <simon.van.casteren@gmail.com>2019-07-31 15:13:18 +0200
commit80e7bb6165a5ad6517b35f301228f56b58eef39c (patch)
treed9f3b42b6cb74ebacc43d4081e5d91aebbe7a20f /src/mod_db.sml
parent83bab4581d9570e151b23db3b4de016600afa76d (diff)
first iteration of "typeOf" command
Diffstat (limited to 'src/mod_db.sml')
-rw-r--r--src/mod_db.sml9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mod_db.sml b/src/mod_db.sml
index de428570..fdf6d5ab 100644
--- a/src/mod_db.sml
+++ b/src/mod_db.sml
@@ -207,6 +207,15 @@ fun lookup (d : Source.decl) =
NONE)
| _ => NONE
+fun lookupForTooling name =
+ case SM.find (!byName, name) of
+ NONE => NONE
+ | SOME m =>
+ SOME (#Decl m, List.map (fn a => #Decl a)
+ (List.mapPartial
+ (fn d => SM.find (!byName, d))
+ (SS.listItems (#Deps m))))
+
val byNameBackup = ref (!byName)
val byIdBackup = ref (!byId)