Verified Commit c510bf89 authored by Camil Staps's avatar Camil Staps 🚀

Implement AND using queries (#52)

parent 098419c3
Subproject commit a69fc68375539176d8b2caf60513ac9951917526
Subproject commit ad80239271d563600088750ee765aa80a0749cbc
......@@ -46,7 +46,7 @@ CACHE_PREFETCH :== 5
, c_name :: Maybe String
, c_className :: Maybe String
, c_typeName :: Maybe String
, c_using :: Bool
, c_using :: Maybe [String]
, c_modules :: Maybe [String]
, c_libraries :: Maybe [String]
, c_include_builtins :: Bool
......@@ -70,7 +70,7 @@ toRequestCacheKey db r
, c_name = toLowerCase <$> r.name
, c_className = r.className
, c_typeName = r.typeName
, c_using = fromMaybe False r.using
, c_using = r.using
, c_modules = sort <$> r.modules
, c_libraries = sort <$> r.libraries
, c_include_builtins = fromMaybe DEFAULT_INCLUDE_BUILTINS r.include_builtins
......@@ -84,7 +84,7 @@ fromRequestCacheKey k =
, name = k.c_name
, className = k.c_className
, typeName = k.c_typeName
, using = Just k.c_using
, using = k.c_using
, modules = k.c_modules
, libraries = k.c_libraries
, include_builtins = Just k.c_include_builtins
......
......@@ -177,12 +177,17 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
}
}
if (substr($name, 0, 6) == 'using ') {
$command['using'] = true;
$name = substr($name, 6);
if ($unify != '') {
$command['unify'] = $unify;
}
if (substr($name, 0, 6) == 'class ') {
if (substr($name, 0, 6) == 'using ') {
$command['using'] = [];
$usingnames = explode(',', substr($name, 6));
foreach ($usingnames as $usingname) {
$command['using'][] = trim($usingname);
}
} elseif (substr($name, 0, 6) == 'class ') {
$command['className'] = substr($name, 6);
} elseif (substr($name, 0, 5) == 'type ') {
$command['typeName'] = substr($name, 5);
......@@ -190,10 +195,6 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
$command['name'] = $name;
}
if ($unify != '') {
$command['unify'] = $unify;
}
if (isset($_GET['lib'])) {
$command['libraries'] = explode(',', $_GET['lib']);
}
......
......@@ -113,12 +113,8 @@
<td class='description'>The class definition of <code>Text</code></td>
</tr>
<tr>
<td class='code'>using type Maybe</td>
<td class='description'>All functions using the type <code>Maybe</code></td>
</tr>
<tr>
<td class='code'>using class ==</td>
<td class='description'>All functions, types and classes using the class <code>==</code></td>
<td class='code'>using Maybe, ==</td>
<td class='description'>Anything that uses <code>Maybe</code> <em>and</em> <code>==</code></td>
</tr>
</table>
<p><b>Besides this web app, there are other frontends available:</b></p>
......
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