Verified Commit f0cb0ca4 authored by Camil Staps's avatar Camil Staps 🙂

Update submodules; add getExactNameMatches (for cloogle-org#226)

parent 3889482a
Subproject commit f290fbe9227cfd8dbd2e6d5d743a3c8bfd8224ee
Subproject commit 44591c3d9744386a8886265f258b18a7124e8ee2
......@@ -286,6 +286,7 @@ filterUsages :: !(*CloogleDB -> *CloogleDB) ![String] !*CloogleDB -> *CloogleDB
allTypeSynonyms :: !*CloogleDB -> *(!Map Name [TypeDef], !*CloogleDB)
alwaysUniquePredicate :: !*CloogleDB -> *(!(String -> Bool), !*CloogleDB)
getExactNameMatches :: !Name !*CloogleDB -> *(![!CloogleEntry!], !*CloogleDB)
getInstances :: !Name !*CloogleDB -> *(![InstanceEntry], !*CloogleDB)
getDerivations :: !Name !*CloogleDB -> *(![DeriveEntry], !*CloogleDB)
......
......@@ -430,13 +430,13 @@ where
filterExactName :: !String !*CloogleDB -> *CloogleDB
filterExactName name wrap=:{db,name_map,syntax,abc_instrs}
# db = 'Database.Native'.searchIndices Intersect [(i,[!ExactResult!]) \\ i <- idxs] db
# db = 'Database.Native'.searchIndices Intersect [(i,[!ExactResult!]) \\ i <-: idxs] db
#! namecs = [c \\ c <-: name]
# db = 'Database.Native'.searchWithIndices` (syntaxSearch namecs) syntax db
# db = 'Database.Native'.searchWithIndices` (abcSearch name) abc_instrs db
= {wrap & db=db}
where
idxs = fromMaybe [] $ fmap (\xs->[x\\x<-:xs]) $ get name name_map
idxs = fromMaybe {} $ get name name_map
syntaxSearch :: ![Char] !CloogleEntry -> (!Bool, ![!Annotation!])
syntaxSearch query (SyntaxEntry se)
......@@ -543,6 +543,13 @@ where
alwaysUniquePredicate :: !*CloogleDB -> *(!(String -> Bool), !*CloogleDB)
alwaysUniquePredicate wrap=:{always_unique} = (isJust o flip get always_unique, wrap)
getExactNameMatches :: !Name !*CloogleDB -> *(![!CloogleEntry!], !*CloogleDB)
getExactNameMatches name wrap=:{db,name_map}
# (values,db) = 'Database.Native'.getValuesByIndices` idxs db
= (values, {wrap & db=db})
where
idxs = fromMaybe {} $ get name name_map
getInstances :: !Name !*CloogleDB -> *(![InstanceEntry], !*CloogleDB)
getInstances c wrap=:{db,instance_map}
| isNothing idxs = ([], wrap)
......
Subproject commit 5ffa74d10ee25696dbf3311bc981c649db777c3a
Subproject commit 9c799bda1eef4749bf1e7e4c606bb32b962a0d37
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