Verified Commit 5571fcf8 authored by Camil Staps's avatar Camil Staps 🙂

Rename to highlightClean; update test header now that there is only one highlighting function

parent 2801b0d4
......@@ -80,12 +80,12 @@ function highlightToHTML(lex, istr, callback, start) {
return ostr;
}
function highlightFunction(func, callback, start) {
function highlightClean(func, callback, start) {
var macroargs = [];
var myCallback = function(span, cls, str) {
if (cls == '__type__')
return highlightFunction(str, callback);
return highlightClean(str, callback);
if (cls == 'argument')
macroargs.push(str);
......@@ -477,7 +477,7 @@ function highlightFunction(func, callback, start) {
}
function highlightType(type, callback) {
return highlightFunction(type, callback, 'type');
return highlightClean(type, callback, 'type');
}
function escapeHTML(unsafe) {
......
......@@ -21,21 +21,28 @@ function parseTestCase(name, contents) {
};
var lines = contents.split('\n');
testcase.type = lines.shift();
lines.shift();
lines.pop();
var reading_result = false;
var parse_state = 0;
for (var i in lines) {
if (lines[i] == '-----') {
reading_result = true;
} else if (reading_result) {
if (testcase.result != '')
testcase.result += '\n';
testcase.result += lines[i];
} else {
if (testcase.test != '')
testcase.test += '\n';
testcase.test += lines[i];
parse_state++;
continue;
}
switch (parse_state) {
case 0:
parts = lines[i].split('=');
testcase[parts[0]] = parts[1];
break;
case 1:
if (testcase.test != '')
testcase.test += '\n';
testcase.test += lines[i];
break;
case 2:
if (testcase.result != '')
testcase.result += '\n';
testcase.result += lines[i];
break;
}
}
......@@ -80,16 +87,7 @@ var htmlResults;
function runTestCase(testcase) {
var f = undefined;
switch (testcase.type) {
case 'Function':
f = highlightFunction;
break;
default:
process.stderr.write(RED + 'Unknown test type "' + testcase.type + '"' + RESET + '\n');
process.exit(1);
}
var result = f(testcase.test, function(span,cls,str){return span}, testcase.entry);
var result = highlightClean(testcase.test, function(span,cls,str){return span}, testcase.entry);
result = parseResult(result);
var passed = result == testcase.result;
......
Function
-----
class Applicative f | Functor f
where
......
Function
-----
class Monad m | Applicative m where
......
Function
-----
class Text s where
......
Function
-----
class Text s // multiple members
where
......
Function
-----
class Traversable t | Functor, Foldable t where
......
Function
-----
class iTask a | gEditor{|*|}, gText{|*|}, JSONEncode{|*|}, JSONDecode{|*|}, gDefault{|*|}, gEq{|*|}, TC a
-----
......
Function
-----
class toInt a :: a -> Int
-----
......
Function
-----
mapAccumL :: (b -> (*s -> *(c, *s))) (t b) *s -> *(t c, *s) | Traversable t
-----
......
Function
-----
mapArrayLSt :: (u:a -> .(.b -> (v:c,.b))) w:(d u:a) .b -> (x:(e v:c),.b) | Array e c & UnsafeArray d & UnsafeArray e & Array d a, [w <= u,x <= v]
-----
......
Function
-----
sort :: !u:[a] -> u:[a] | Ord a
special
......
Function
-----
sqlExecute :: SQLDatabaseDef [String] (A.*cur: (*cur -> *(MaybeErrorString a,*cur)) | SQLCursor cur) -> Task a | iTask a
-----
......
Function
-----
sqlShare :: String (A.*cur: (p -> *cur -> *(MaybeErrorString r,*cur)) | SQLCursor cur) (A.*cur: (p -> w -> *cur -> *(MaybeErrorString (),*cur)) | SQLCursor cur) -> RWShared (SQLDatabaseDef,p) r w
-----
......
Function
-----
sleep :: !Int !*World -> *(!Int, !*World) // Linking with C
sleep n w = code {
......
Function
-----
instance zero Real where zero = 0.0
-----
......
Function:macro
entry=macro
-----
foldl :: (a -> b -> a) a [b] -> a
foldl op r l :== foldl r l
......
Function
-----
definition module StdList // Exported definitions of list functions
-----
......
Function
-----
:: SDS p r w
= SDSSource (SDSSource p r w)
......
Function
-----
:: Server ci st =
{ idleTimeout :: Maybe Int //* Time between ticks when nothing happens in ms
......
Function
-----
:: WebService r w =
{ urlMatchPred :: !(String -> Bool) // checks whether the URL is served by this service
......
Function
-----
:: List = E.e: Cons e List | Nil
Start = Cons 5 (Cons 'a' (Cons "abc" Nil))
......
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