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

Merge branch 'master' of github.com:clean-cloogle/cloogle.org

parents 200272fa 21b3cfaf
......@@ -19,7 +19,8 @@ import Builtin.Predef
builtin_syntax :: [SyntaxEntry]
builtin_syntax =
[ bs_case
[ bs_basicvalues
, bs_case
, bs_class
, bs_code
, bs_comments
......@@ -76,6 +77,31 @@ EX c = {example=c, cleanjs_start=Nothing}
EXs :: !String !String -> SyntaxExample
EXs s c = {example=c, cleanjs_start=Just s}
bs_basicvalues =
{ syntax_title = "basic values"
, syntax_patterns = map exact ["'.'", "[+-]?\\d+", "[+-]?0[0-7]+", "[-+]?0x[0-9a-fA-F]+", "E"]
, syntax_code = ["0x...", "0...", "'...'", "...E..."]
, syntax_description =
"Constant basic values can be of type {{`Int`}}, {{`Char`}} and {{`Real`}}. See also {{`Bool`}}.\n\n" +
"Integers can be specified in decimal (default), octal (`0` prefix) or hexadecimal (`0x` prefix) notation.\n\n" +
"Characters can either be printable characters (except `'`) or an escape sequence.\n" +
"An escape sequence is a character escape, a hexademical escape (starting with `x`), an octal escape (starting with `0` to `7`) or a decimal escape (starting with `d`).\n\n" +
"Reals can be suffixed by a power of ten in the scientific notation.\n\n" +
"Basic values can also be pattern matched with these notations."
, syntax_doc_locations = [CLR 6 "4.1.1" "_Toc311798017"]
, syntax_examples = map (EXs "rhs")
[ "(42, -42, +42) // Tuple with 42, -42 and 42 in decimal notation"
, "(052, -052, +052) // Tuple with 42, -42 and 42 in octal notation"
, "(0x2a, -0x2a, +0x2A) // Tuple with 42, -42 and 42 in hexadecimal notation"
, "('a', '\\x2a', '\\052') // Tuple with a normal character and twice the character with ASCII value 42"
, "['\\n', '\\r', '\\f', '\\b', '\\t', '\\v', '\\', '\\'', '\\\"']\n" +
" // All character escapes"
, "(42.0, -42.0, 42E-10, +42.0E+10, -42.0E10)\n" +
" // Several reals"
]
}
bs_case =
{ syntax_title = "case expression"
, syntax_patterns = map exact ["case", "of", "case of", "->", "="]
......@@ -142,7 +168,9 @@ bs_context =
, "To add multiple restrictions, use `&`.\n"
, "In constructors, the type context starts with `&`.\n"
, "Uniqueness constraints can be given with `,`. For details, see under {{`,`}}.\n"
, "With the `special` keyword, specialised instances for certain type instantiations are exported for efficiency."
, "With the `special` keyword, specialised instances for certain type instantiations are exported for efficiency.\n"
, "The context of a generic function can only contain other generic functions."
, "The generic context is written without kinds and separated by `,` as seen in the example."
]
, syntax_doc_locations = [CLR 8 "6.2" "_Toc311798057"]
, syntax_examples = map EX
......@@ -150,6 +178,7 @@ bs_context =
, "sum :: [a] -> a | zero, + a // a must instantiate zero and +\nsum [] = zero\nsum [x:xs] = x + sum xs"
, "(<+) infixr 5 :: a b -> String | toString a & toString b // a and b must instantiate toString\n(<+) x y = toString x +++ toString y"
, "isMember :: a [a] -> Bool special a=Int // specialised instance for integer lists for efficiency"
, "generic gFun a | gDefault a, gEq a :: a -> Int // generic context"
]
}
......@@ -304,16 +333,20 @@ bs_guard =
bs_generic =
{ syntax_title = "generic function definition"
, syntax_patterns = map exact ["generic", "derive", "of", "\\{\\|.*\\|\\}"]
, syntax_code = ["generic ... ... :: ...", "derive ... ..."]
, syntax_patterns = map exact ["generic", "derive", "of", "with", "\\{\\|.*\\|\\}"]
, syntax_code = ["generic ... ... [| ...] :: ... ", "derive ... ... [of ...] [with ...]"]
, syntax_description = "With generics, a function can be defined once and derived for (almost) all possible types, to avoid very similar code snippets."
, syntax_doc_locations = [CLR 9 "7.2" "_Toc311798069"]
, syntax_examples =
[ EX "generic gEq a :: !a !a -> Bool // The type of a generic function"
, EXs "macro" $ "gEq{|Int|} x y = x == y // Implementation of a generic\n" +
"gEq{|PAIR|} fx fy (PAIR x1 y1) (PAIR x2 y2) = fx x1 x2 && fy y1 y2" // TODO highlighting
, EX "derive gEq [] // Deriving the gEq generic for type []"
, EXs "macro" "gConsName{|CONS of d|} _ = d.gcd_name // Using type information"
, syntax_examples = map EX
[ "generic gEq a :: !a !a -> Bool // The type of a generic function"
, "gEq{|Int|} x y = x == y // Implementation of a generic\n" +
"gEq{|PAIR|} fx fy (PAIR x1 y1) (PAIR x2 y2) = fx x1 x2 && fy y1 y2"
, "derive gEq [] // Deriving the gEq generic for type []"
, "gConsName{|CONS of d|} _ = d.gcd_name // Using type information"
, "gFun{|CONS of {gcd_arity}|} // Using a specific field of type information, the compiler will only provide this field which makes it a lot faster"
, "generic gFun a :: a -> Int | gDefault a // A generic function with a generic context. The context will become an argument.\n" +
"derive gFun CONS of {gcd_arity} with f _ // A derivation that does not use all arguments. The ompiler can optimize even more\n" +
"gFun{|CONS of {gcd_arity}|} f _ = // A derivation that does not use the context and only one field of the generic type descriptor, the compiler can optimize for this."
]
}
......@@ -450,6 +483,7 @@ bs_list_expressions =
[ "abc = ['a', 'b', 'c'] // Individual elements"
, "abc = ['a':['b':['c':[]]] // Head and tail, ending with the empty list"
, "abc = ['abc'] // Special syntax for [Char] lists"
, "abc ['abc':rest] = True // The special syntax can als be used to patternmatch"
]
}
......
Subproject commit 238392d49c0f03f43a08ba7c73a77610a26c74c4
Subproject commit c513a02100265cbab2faadcc1b217e83a8968cc2
......@@ -5,7 +5,7 @@ COPY libs.json /usr/src/cloogle/libs.json
COPY util/fetch_libs.sh /usr/src/cloogle/fetch_libs.sh
WORKDIR /usr/src/cloogle
RUN install_clean.sh bundle-complete 2018-07-05 \
RUN install_clean.sh bundle-complete 2018-07-12 \
&& PACKAGES="patch jq" \
&& apt-get update -qq\
&& apt-get install -qq $PACKAGES --no-install-recommends\
......
......@@ -10,7 +10,6 @@ CLMFLAGS:=-h 250M -nr -nortsopts\
-IL Platform/Deprecated/StdLib\
-I Cloogle\
-I Cloogle/libcloogle\
-I Cloogle/CleanPrettyPrint\
-I Cloogle/CleanRegex
ifeq "$(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 6)" "1"
CLMFLAGS+=-l -no-pie
......
......@@ -46,9 +46,9 @@ RUN apt-get update -qq && apt-get install -qq python3 ca-certificates git\
&& apt-get remove -qq python3 ca-certificates git\
&& apt-get autoremove -qq
RUN apt-get update -qq && apt-get install -qq ca-certificates\
&& mkdir /var/www/clean.js\
&& curl -L $(curl -s https://api.github.com/repos/clean-cloogle/clean.js/releases/latest | grep browser_ | cut -d'"' -f4)\
| tar xzv --strip-components=1 --directory=/var/www/clean.js\
&& apt-get remove -qq ca-certificates\
RUN apt-get update -qq && apt-get install -qq ca-certificates jq\
&& mkdir /var/www/clean-highlighter\
&& curl $(curl https://registry.npmjs.org/clean-highlighter/ | jq -r '.versions[."dist-tags".latest].dist.tarball')\
| tar xzv --strip-components=1 --directory=/var/www/clean-highlighter\
&& apt-get remove -qq ca-certificates jq\
&& apt-get autoremove -qq
../clean-highlighter
\ No newline at end of file
../clean.js
\ No newline at end of file
......@@ -7,11 +7,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="description" content="Cloogle is the unofficial Clean language search engine"/>
<meta name="keywords" content="Clean,Clean language,Concurrent Clean,search,functions,search engine,programming language,clean platform,iTasks,cloogle,hoogle"/>
<script src="clean.js/clean.js" defer="defer"></script>
<script src="clean-highlighter/clean.js" defer="defer"></script>
<script src="common.js" defer="defer"></script>
<script src="api.js" defer="defer"></script>
<link rel="stylesheet" href="common.css" type="text/css"/>
<link rel="stylesheet" href="clean.js/clean.css" type="text/css"/>
<link rel="stylesheet" href="clean-highlighter/clean.css" type="text/css"/>
<link rel="stylesheet" href="frontend.css" type="text/css"/>
</head>
<body>
......
......@@ -7,11 +7,11 @@
<meta name="description" content="Cloogle is the unofficial Clean language search engine"/>
<meta name="keywords" content="Clean,Clean language,Concurrent Clean,search,functions,search engine,programming language,clean platform,iTasks,cloogle,hoogle"/>
<script src="../common.js" defer="defer"></script>
<script src="../clean.js/clean.js" defer="defer"></script>
<script src="../clean-highlighter/clean.js" defer="defer"></script>
<script src="../browser.js" defer="defer"></script>
<script src="view.js" defer="defer"></script>
<link rel="stylesheet" href="../common.css" type="text/css"/>
<link rel="stylesheet" href="../clean.js/clean.css" type="text/css"/>
<link rel="stylesheet" href="../clean-highlighter/clean.css" type="text/css"/>
<link rel="stylesheet" href="view.css" type="text/css"/>
</head>
<body class="framelike">
......
......@@ -6,10 +6,10 @@
<meta name="description" content="Live Cloogle statistics"/>
<title>Live Cloogle Stats</title>
<script type="text/javascript" src="chart.js" defer="defer"></script>
<script type="text/javascript" src="../clean.js/clean.js" defer="defer"></script>
<script type="text/javascript" src="../clean-highlighter/clean.js" defer="defer"></script>
<script type="text/javascript" src="../common.js" defer="defer"></script>
<script type="text/javascript" src="client.js" defer="defer"></script>
<link rel="stylesheet" href="../clean.js/clean.css" type="text/css"/>
<link rel="stylesheet" href="../clean-highlighter/clean.css" type="text/css"/>
<style type="text/css">
#title {
font-family: sans-serif;
......
......@@ -49,7 +49,7 @@
{
"name": "clean-compiler",
"fetch_url": ["SVN", "https://svn.cs.ru.nl/repos/clean-compiler"],
"path": "trunk",
"path": "branches/itask",
"info_url": "https://svn.cs.ru.nl/repos/clean-compiler/",
"pattern_app": [["PWildcard"]]
},
......@@ -108,11 +108,6 @@
"fetch_url": ["Git", "https://github.com/camilstaps/CleanInotify"],
"info_url": "https://github.com/camilstaps/CleanInotify"
},
{
"name": "CleanPrettyPrint",
"fetch_url": ["Git", "https://github.com/clean-cloogle/CleanPrettyPrint"],
"info_url": "https://github.com/clean-cloogle/CleanPrettyPrint"
},
{
"name": "CleanRegex",
"fetch_url": ["Git", "https://github.com/camilstaps/CleanRegex"],
......
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