highlighting-kate 0.5.13 → 0.5.14
raw patch · 30 files changed
+124/−84 lines, 30 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Makefile +1/−1
- Text/Highlighting/Kate/Format/HTML.hs +9/−5
- changelog +11/−0
- highlighting-kate.cabal +1/−1
- tests/abc.ada.html +4/−3
- tests/abc.c.html +4/−3
- tests/abc.clojure.html +4/−3
- tests/abc.cpp.html +4/−3
- tests/abc.cs.html +4/−3
- tests/abc.d.html +4/−3
- tests/abc.fortran.html +4/−3
- tests/abc.go.html +4/−3
- tests/abc.haskell.html +4/−3
- tests/abc.java.html +4/−3
- tests/abc.javascript.html +4/−3
- tests/abc.julia.html +4/−3
- tests/abc.lisp.html +2/−2
- tests/abc.matlab.html +4/−3
- tests/abc.ocaml.html +4/−3
- tests/abc.perl.html +4/−3
- tests/abc.php.html +4/−3
- tests/abc.prolog.html +4/−3
- tests/abc.python.html +4/−3
- tests/abc.r.html +4/−3
- tests/abc.ruby.html +4/−3
- tests/abc.scala.html +4/−3
- tests/abc.scheme.html +4/−3
- tests/abc.tcl.html +4/−3
- tests/archive.rhtml.html +4/−3
- tests/life.lua.html +4/−3
Makefile view
@@ -31,7 +31,7 @@ ParseSyntaxFiles: ParseSyntaxFiles.hs cabal install HXT regex-posix- ghc --make -Wall ParseSyntaxFiles.hs # requires HXT >= 9.0.0+ cabal exec ghc -- --make -Wall ParseSyntaxFiles.hs # requires HXT >= 9.0.0 clean: rm -rf Text/Highlighting/Kate/Syntax/*
Text/Highlighting/Kate/Format/HTML.hs view
@@ -72,12 +72,14 @@ -- | Format tokens as an HTML @pre@ block. If line numbering is -- selected, this is put into a table row with line numbers in the--- left cell and the table is wrapped in a @pre@ block.+-- left cell. The whole code block is wrapped in a @div@ element+-- to aid styling (e.g. the overflow-x property). formatHtmlBlock :: FormatOptions -> [SourceLine] -> Html-formatHtmlBlock opts ls = container ! A.class_ (toValue $ unwords classes)+formatHtmlBlock opts ls = H.div ! A.class_ sourceCode $+ container ! A.class_ (toValue $ unwords classes) where container = if numberLines opts- then H.pre $ H.table $ H.tr ! A.class_ sourceCode- $ nums >> source+ then H.table $ H.tr ! A.class_ sourceCode $+ nums >> source else pre sourceCode = toValue "sourceCode" classes = "sourceCode" :@@ -93,9 +95,10 @@ >> toHtml "\n" else toHtml $ show n ++ "\n" where nStr = show n+ -- | Returns CSS for styling highlighted code according to the given style. styleToCss :: Style -> String-styleToCss f = unlines $ tablespec ++ colorspec ++ map toCss (tokenStyles f)+styleToCss f = unlines $ divspec ++ tablespec ++ colorspec ++ map toCss (tokenStyles f) where colorspec = case (defaultColor f, backgroundColor f) of (Nothing, Nothing) -> [] (Just c, Nothing) -> ["pre, code { color: " ++ fromColor c ++ "; }"]@@ -116,6 +119,7 @@ "}" ,"td.sourceCode { padding-left: 5px; }" ]+ divspec = [ "div.sourceCode { overflow-x: auto; }" ] toCss :: (TokenType, TokenStyle) -> String toCss (t,tf) = "code > span." ++ short t ++ " { "
changelog view
@@ -1,3 +1,14 @@+highlighting-kate 0.5.14 (28 Mar 2015)++ * Put code blocks in a div. This reverts the change in 0.5.13,+ wrapping all blocks in a pre element. (Pre elements are only+ supposed to contain flow content, not block-level elements like+ tables.) Instead we now wrap each code block in a div with class+ `sourceCode`.+ * The default CSS now includes `div.sourceCode { x-overflow: auto; }`,+ so that a scroll bar will appear on small screens. See jgm/pandoc#1903+ and jgm/highlighting-kate#65 for background.+ highlighting-kate 0.5.13 (27 Mar 2015) * Wrap HTML table with line numbers in a pre element (Adam Sapek).
highlighting-kate.cabal view
@@ -1,5 +1,5 @@ Name: highlighting-kate-Version: 0.5.13+Version: 0.5.14 Cabal-Version: >= 1.10 Build-Type: Simple Category: Text
tests/abc.ada.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">with</span> Ada.Characters.Handling;+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">with</span> Ada.Characters.Handling; <span class="kw" title="KeywordTok">use</span> Ada.Characters.Handling; @@ -93,4 +94,4 @@ Put_Line ( To_String(words(I)) & <span class="st" title="StringTok">": "</span> & Boolean'Image(Can_Make_Word(To_String(words(I)),Blocks)) ); <span class="kw" title="KeywordTok">end loop</span>; <span class="kw" title="KeywordTok">end</span> Abc_Problem;-</code></pre></body>+</code></pre></div></body>
tests/abc.c.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="ot" title="OtherTok">#include <stdio.h></span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="ot" title="OtherTok">#include <stdio.h></span> <span class="ot" title="OtherTok">#include <ctype.h></span> <span class="dt" title="DataTypeTok">int</span> can_make_words(<span class="dt" title="DataTypeTok">char</span> **b, <span class="dt" title="DataTypeTok">char</span> *word)@@ -55,4 +56,4 @@ printf(<span class="st" title="StringTok">"%s</span><span class="ch" title="CharTok">\t</span><span class="st" title="StringTok">%d</span><span class="ch" title="CharTok">\n</span><span class="st" title="StringTok">"</span>, *w, can_make_words(blocks, *w)); <span class="kw" title="KeywordTok">return</span> <span class="dv" title="DecValTok">0</span>;-}</code></pre></body>+}</code></pre></div></body>
tests/abc.clojure.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"> (<span class="kw" title="KeywordTok">def</span><span class="fu" title="FunctionTok"> blocks</span> (<span class="kw" title="KeywordTok">-></span> <span class="st" title="StringTok">"BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM"</span> (.split <span class="st" title="StringTok">" "</span>) <span class="kw" title="KeywordTok">vec</span>)) @@ -36,4 +37,4 @@ (<span class="kw" title="KeywordTok">doseq</span> [word [<span class="st" title="StringTok">"A"</span> <span class="st" title="StringTok">"BARK"</span> <span class="st" title="StringTok">"Book"</span> <span class="st" title="StringTok">"treat"</span> <span class="st" title="StringTok">"COMMON"</span> <span class="st" title="StringTok">"SQUAD"</span> <span class="st" title="StringTok">"CONFUSE"</span>]]- (<span class="kw" title="KeywordTok">->></span> word .toUpperCase (abc blocks) <span class="kw" title="KeywordTok">first</span> (<span class="kw" title="KeywordTok">printf</span> <span class="st" title="StringTok">"%s: %b</span>\n<span class="st" title="StringTok">"</span> word)))</code></pre></body>+ (<span class="kw" title="KeywordTok">->></span> word .toUpperCase (abc blocks) <span class="kw" title="KeywordTok">first</span> (<span class="kw" title="KeywordTok">printf</span> <span class="st" title="StringTok">"%s: %b</span>\n<span class="st" title="StringTok">"</span> word)))</code></pre></div></body>
tests/abc.cpp.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="ot" title="OtherTok">#include <iostream></span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="ot" title="OtherTok">#include <iostream></span> <span class="ot" title="OtherTok">#include <vector></span> <span class="ot" title="OtherTok">#include <string></span> <span class="ot" title="OtherTok">#include <set></span>@@ -51,4 +52,4 @@ std::cout << w << <span class="st" title="StringTok">": "</span> << std::boolalpha << can_make_word(w,vals) << <span class="st" title="StringTok">".</span><span class="ch" title="CharTok">\n</span><span class="st" title="StringTok">"</span>; } -}</code></pre></body>+}</code></pre></div></body>
tests/abc.cs.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">using</span> System.<span class="fu" title="FunctionTok">Collections</span>.<span class="fu" title="FunctionTok">Generic</span>;+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">using</span> System.<span class="fu" title="FunctionTok">Collections</span>.<span class="fu" title="FunctionTok">Generic</span>; <span class="kw" title="KeywordTok">using</span> System.<span class="fu" title="FunctionTok">Linq</span>; <span class="dt" title="DataTypeTok">void</span> <span class="fu" title="FunctionTok">Main</span>()@@ -97,4 +98,4 @@ <span class="kw" title="KeywordTok">return</span> <span class="kw" title="KeywordTok">false</span>; } }-</code></pre></body>+</code></pre></div></body>
tests/abc.d.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import</span> std.stdio, std.ascii, std.algorithm, std.array, std.range;+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import</span> std.stdio, std.ascii, std.algorithm, std.array, std.range; <span class="kw" title="KeywordTok">alias</span> Block = <span class="dt" title="DataTypeTok">char</span>[<span class="dv" title="DecValTok">2</span>]; @@ -56,4 +57,4 @@ <span class="kw" title="KeywordTok">immutable</span> Block[] blocks2 = [<span class="st" title="StringTok">"AB"</span>, <span class="st" title="StringTok">"AB"</span>, <span class="st" title="StringTok">"AC"</span>, <span class="st" title="StringTok">"AC"</span>]; <span class="kw" title="KeywordTok">immutable</span> word = <span class="st" title="StringTok">"abba"</span>; writefln(<span class="st" title="StringTok">`"%s" %s`</span>, word, blocks2.canMakeWord(word));-}</code></pre></body>+}</code></pre></div></body>
tests/abc.fortran.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="co" title="CommentTok">!-*- mode: compilation; default-directory: "/tmp/" -*-</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="co" title="CommentTok">!-*- mode: compilation; default-directory: "/tmp/" -*-</span> <span class="co" title="CommentTok">!Compilation started at Thu Jun 5 01:52:03</span> <span class="co" title="CommentTok">!</span> <span class="co" title="CommentTok">!make f && for a in '' a bark book treat common squad confuse ; do echo $a | ./f ; done</span>@@ -84,4 +85,4 @@ <span class="kw" title="KeywordTok">end do</span> <span class="kw" title="KeywordTok">end subroutine</span> ucase -<span class="kw" title="KeywordTok">end program</span> abc</code></pre></body>+<span class="kw" title="KeywordTok">end program</span> abc</code></pre></div></body>
tests/abc.go.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">package</span> main+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">package</span> main <span class="kw" title="KeywordTok">import</span> ( <span class="st" title="StringTok">"fmt"</span>@@ -53,4 +54,4 @@ <span class="st" title="StringTok">"A"</span>, <span class="st" title="StringTok">"BARK"</span>, <span class="st" title="StringTok">"BOOK"</span>, <span class="st" title="StringTok">"TREAT"</span>, <span class="st" title="StringTok">"COMMON"</span>, <span class="st" title="StringTok">"SQUAD"</span>, <span class="st" title="StringTok">"CONFUSE"</span>} { fmt.Println(word, sp(word)) }-}</code></pre></body>+}</code></pre></div></body>
tests/abc.haskell.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import </span><span class="dt" title="DataTypeTok">Data.List</span> (delete)+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import </span><span class="dt" title="DataTypeTok">Data.List</span> (delete) <span class="kw" title="KeywordTok">import </span><span class="dt" title="DataTypeTok">Data.Char</span> (toUpper) <span class="co" title="CommentTok">-- returns list of all solutions, each solution being a list of blocks</span>@@ -29,4 +30,4 @@ <span class="ot" title="OtherTok">main ::</span> <span class="dt" title="DataTypeTok">IO</span> () main <span class="fu" title="FunctionTok">=</span> mapM_ (\w <span class="ot" title="OtherTok">-></span> print (w, not <span class="fu" title="FunctionTok">.</span> null <span class="fu" title="FunctionTok">$</span> abc blocks (map toUpper w)))- [<span class="st" title="StringTok">""</span>, <span class="st" title="StringTok">"A"</span>, <span class="st" title="StringTok">"BARK"</span>, <span class="st" title="StringTok">"BoOK"</span>, <span class="st" title="StringTok">"TrEAT"</span>, <span class="st" title="StringTok">"COmMoN"</span>, <span class="st" title="StringTok">"SQUAD"</span>, <span class="st" title="StringTok">"conFUsE"</span>]</code></pre></body>+ [<span class="st" title="StringTok">""</span>, <span class="st" title="StringTok">"A"</span>, <span class="st" title="StringTok">"BARK"</span>, <span class="st" title="StringTok">"BoOK"</span>, <span class="st" title="StringTok">"TrEAT"</span>, <span class="st" title="StringTok">"COmMoN"</span>, <span class="st" title="StringTok">"SQUAD"</span>, <span class="st" title="StringTok">"conFUsE"</span>]</code></pre></div></body>
tests/abc.java.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import java.util.Arrays;</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">import java.util.Arrays;</span> <span class="kw" title="KeywordTok">public</span> <span class="kw" title="KeywordTok">class</span> ABC{ <span class="kw" title="KeywordTok">private</span> <span class="dt" title="DataTypeTok">static</span> <span class="dt" title="DataTypeTok">void</span> <span class="fu" title="FunctionTok">swap</span>(<span class="dt" title="DataTypeTok">int</span> i, <span class="dt" title="DataTypeTok">int</span> j, Object<span class="kw" title="KeywordTok">... </span>arr){@@ -58,4 +59,4 @@ System.<span class="fu" title="FunctionTok">out</span>.<span class="fu" title="FunctionTok">println</span>(<span class="st" title="StringTok">"CONFUSE: "</span> + <span class="fu" title="FunctionTok">canMakeWord</span>(<span class="st" title="StringTok">"CONFUSE"</span>, blocks)); }-}</code></pre></body>+}</code></pre></div></body>
tests/abc.javascript.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">let</span> characters = <span class="st" title="StringTok">"BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM"</span>;+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">let</span> characters = <span class="st" title="StringTok">"BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM"</span>; <span class="kw" title="KeywordTok">let</span> blocks = <span class="ot" title="OtherTok">characters</span>.<span class="fu" title="FunctionTok">split</span>(<span class="st" title="StringTok">" "</span>).<span class="fu" title="FunctionTok">map</span>(pair => <span class="ot" title="OtherTok">pair</span>.<span class="fu" title="FunctionTok">split</span>(<span class="st" title="StringTok">""</span>)); <span class="kw" title="KeywordTok">function</span> <span class="fu" title="FunctionTok">isWordPossible</span>(word) {@@ -47,4 +48,4 @@ <span class="st" title="StringTok">"SQUAD"</span>, <span class="st" title="StringTok">"CONFUSE"</span> ].<span class="fu" title="FunctionTok">forEach</span>(word => <span class="ot" title="OtherTok">console</span>.<span class="fu" title="FunctionTok">log</span>(`${word}: ${<span class="fu" title="FunctionTok">isWordPossible</span>(word)}`));-</code></pre></body>+</code></pre></div></body>
tests/abc.julia.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">function</span> abc (str, list)+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">function</span> abc (str, list) isempty(str) && <span class="kw" title="KeywordTok">return</span> true <span class="kw" title="KeywordTok">for</span> i = <span class="fl" title="FloatTok">1</span>:length(list) str[<span class="kw" title="KeywordTok">end</span>] <span class="kw" title="KeywordTok">in</span> list[i] && @@ -23,4 +24,4 @@ <span class="kw" title="KeywordTok">return</span> true <span class="kw" title="KeywordTok">end</span> false-<span class="kw" title="KeywordTok">end</span></code></pre></body>+<span class="kw" title="KeywordTok">end</span></code></pre></div></body>
tests/abc.lisp.html view
@@ -15,7 +15,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"> (<span class="kw" title="KeywordTok">defun</span><span class="fu" title="FunctionTok"> word-possible-p </span>(word blocks) (<span class="kw" title="KeywordTok">cond</span> ((<span class="kw" title="KeywordTok">=</span> (<span class="kw" title="KeywordTok">length</span> word) <span class="dv" title="DecValTok">0</span>) <span class="kw" title="KeywordTok">t</span>)@@ -29,4 +29,4 @@ (<span class="kw" title="KeywordTok">loop</span> for b in bs collect (word-possible-p (<span class="kw" title="KeywordTok">subseq</span> word <span class="dv" title="DecValTok">1</span>)- (<span class="kw" title="KeywordTok">remove</span> b blocks))))))))</code></pre></body>+ (<span class="kw" title="KeywordTok">remove</span> b blocks))))))))</code></pre></div></body>
tests/abc.matlab.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">function testABC+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">function testABC combos = [<span class="st" title="StringTok">'BO'</span> ; <span class="st" title="StringTok">'XK'</span> ; <span class="st" title="StringTok">'DQ'</span> ; <span class="st" title="StringTok">'CP'</span> ; <span class="st" title="StringTok">'NA'</span> ; <span class="st" title="StringTok">'GT'</span> ; <span class="st" title="StringTok">'RE'</span> ; <span class="st" title="StringTok">'TG'</span> ; <span class="st" title="StringTok">'QD'</span> ; ... <span class="st" title="StringTok">'FS'</span> ; <span class="st" title="StringTok">'JW'</span> ; <span class="st" title="StringTok">'HU'</span> ; <span class="st" title="StringTok">'VI'</span> ; <span class="st" title="StringTok">'AN'</span> ; <span class="st" title="StringTok">'OB'</span> ; <span class="st" title="StringTok">'ER'</span> ; <span class="st" title="StringTok">'FS'</span> ; <span class="st" title="StringTok">'LY'</span> ; ... <span class="st" title="StringTok">'PC'</span> ; <span class="st" title="StringTok">'ZM'</span>];@@ -40,4 +41,4 @@ end k = k+<span class="fl" title="FloatTok">1</span>; end-end</code></pre></body>+end</code></pre></div></body>
tests/abc.ocaml.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">let</span> blocks = [+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">let</span> blocks = [ (<span class="ch" title="CharTok">'B'</span>, <span class="ch" title="CharTok">'O'</span>); (<span class="ch" title="CharTok">'X'</span>, <span class="ch" title="CharTok">'K'</span>); (<span class="ch" title="CharTok">'D'</span>, <span class="ch" title="CharTok">'Q'</span>); (<span class="ch" title="CharTok">'C'</span>, <span class="ch" title="CharTok">'P'</span>); (<span class="ch" title="CharTok">'N'</span>, <span class="ch" title="CharTok">'A'</span>); (<span class="ch" title="CharTok">'G'</span>, <span class="ch" title="CharTok">'T'</span>); (<span class="ch" title="CharTok">'R'</span>, <span class="ch" title="CharTok">'E'</span>); (<span class="ch" title="CharTok">'T'</span>, <span class="ch" title="CharTok">'G'</span>); (<span class="ch" title="CharTok">'Q'</span>, <span class="ch" title="CharTok">'D'</span>); (<span class="ch" title="CharTok">'F'</span>, <span class="ch" title="CharTok">'S'</span>); (<span class="ch" title="CharTok">'J'</span>, <span class="ch" title="CharTok">'W'</span>); (<span class="ch" title="CharTok">'H'</span>, <span class="ch" title="CharTok">'U'</span>);@@ -54,4 +55,4 @@ <span class="st" title="StringTok">"COMMON"</span>, <span class="kw" title="KeywordTok">false</span>; <span class="st" title="StringTok">"SQUAD"</span>, <span class="kw" title="KeywordTok">true</span>; <span class="st" title="StringTok">"CONFUSE"</span>, <span class="kw" title="KeywordTok">true</span>;- ]</code></pre></body>+ ]</code></pre></div></body>
tests/abc.perl.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="fu" title="FunctionTok">use</span> <span class="fu" title="FunctionTok">Test::More</span> tests => <span class="dv" title="DecValTok">8</span>;+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="fu" title="FunctionTok">use</span> <span class="fu" title="FunctionTok">Test::More</span> tests => <span class="dv" title="DecValTok">8</span>; <span class="kw" title="KeywordTok">my</span> <span class="dt" title="DataTypeTok">@blocks1</span> = <span class="kw" title="KeywordTok">qw(</span>BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM<span class="kw" title="KeywordTok">)</span>; is(can_make_word(<span class="kw" title="KeywordTok">"</span><span class="st" title="StringTok">A</span><span class="kw" title="KeywordTok">"</span>, <span class="dt" title="DataTypeTok">@blocks1</span>), <span class="dv" title="DecValTok">1</span>);@@ -28,4 +29,4 @@ <span class="kw" title="KeywordTok">my</span> <span class="dt" title="DataTypeTok">@blocks2</span> = <span class="kw" title="KeywordTok">qw(</span>US TZ AO QA<span class="kw" title="KeywordTok">)</span>; is(can_make_word(<span class="kw" title="KeywordTok">'</span><span class="st" title="StringTok">auto</span><span class="kw" title="KeywordTok">'</span>, <span class="dt" title="DataTypeTok">@blocks2</span>), <span class="dv" title="DecValTok">1</span>);-</code></pre></body>+</code></pre></div></body>
tests/abc.php.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"> <span class="kw" title="KeywordTok"><?php</span> <span class="kw" title="KeywordTok">$words</span> = <span class="fu" title="FunctionTok">array</span><span class="ot" title="OtherTok">(</span><span class="st" title="StringTok">"A"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"BARK"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"BOOK"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"TREAT"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"COMMON"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"SQUAD"</span><span class="ot" title="OtherTok">,</span> <span class="st" title="StringTok">"Confuse"</span><span class="ot" title="OtherTok">);</span> @@ -44,4 +45,4 @@ <span class="fu" title="FunctionTok">echo</span> <span class="kw" title="KeywordTok">$word</span>.<span class="st" title="StringTok">': '</span><span class="ot" title="OtherTok">;</span> <span class="fu" title="FunctionTok">echo</span> canMakeWord<span class="ot" title="OtherTok">(</span><span class="kw" title="KeywordTok">$word</span><span class="ot" title="OtherTok">)</span> <span class="ot" title="OtherTok">?</span> <span class="st" title="StringTok">"True"</span> <span class="ot" title="OtherTok">:</span> <span class="st" title="StringTok">"False"</span><span class="ot" title="OtherTok">;</span> <span class="fu" title="FunctionTok">echo</span> <span class="st" title="StringTok">"</span><span class="kw" title="KeywordTok">\r\n</span><span class="st" title="StringTok">"</span><span class="ot" title="OtherTok">;</span>-}</code></pre></body>+}</code></pre></div></body>
tests/abc.prolog.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">abc_problem <span class="kw" title="KeywordTok">:-</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">abc_problem <span class="kw" title="KeywordTok">:-</span> maplist(abc_problem<span class="kw" title="KeywordTok">,</span> ['', '<span class="er" title="ErrorTok">A</span>', bark, bOOk, treAT, '<span class="er" title="ErrorTok">COmmon</span>', sQuaD, '<span class="er" title="ErrorTok">CONFUSE</span>'])<span class="kw" title="KeywordTok">.</span> @@ -37,4 +38,4 @@ can_makeword(<span class="dt" title="DataTypeTok">L</span><span class="kw" title="KeywordTok">,</span> [<span class="dt" title="DataTypeTok">H</span> <span class="fu" title="FunctionTok">|</span> <span class="dt" title="DataTypeTok">T</span>]) <span class="kw" title="KeywordTok">:-</span> ( select([<span class="dt" title="DataTypeTok">H</span>, <span class="dt" title="DataTypeTok">_</span>]<span class="kw" title="KeywordTok">,</span> <span class="dt" title="DataTypeTok">L</span><span class="kw" title="KeywordTok">,</span> <span class="dt" title="DataTypeTok">L1</span>)<span class="kw" title="KeywordTok">;</span> select([<span class="dt" title="DataTypeTok">_</span>, <span class="dt" title="DataTypeTok">H</span>]<span class="kw" title="KeywordTok">,</span> <span class="dt" title="DataTypeTok">L</span><span class="kw" title="KeywordTok">,</span> <span class="dt" title="DataTypeTok">L1</span>))<span class="kw" title="KeywordTok">,</span> can_makeword(<span class="dt" title="DataTypeTok">L1</span><span class="kw" title="KeywordTok">,</span> <span class="dt" title="DataTypeTok">T</span>)<span class="kw" title="KeywordTok">.</span>-</code></pre></body>+</code></pre></div></body>
tests/abc.python.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">def</span> mkword(w, b):+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">def</span> mkword(w, b): <span class="kw" title="KeywordTok">if</span> not w: <span class="kw" title="KeywordTok">return</span> [] c,w = w[<span class="dv" title="DecValTok">0</span>],w[<span class="dv" title="DecValTok">1</span>:]@@ -30,4 +31,4 @@ blocks = <span class="st" title="StringTok">'BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM'</span>.split() <span class="kw" title="KeywordTok">for</span> w in <span class="st" title="StringTok">", A, bark, book, treat, common, SQUAD, conFUsEd"</span>.split(<span class="st" title="StringTok">', '</span>):- <span class="dt" title="DataTypeTok">print</span> <span class="st" title="StringTok">'</span><span class="ch" title="CharTok">\'</span><span class="st" title="StringTok">'</span> + w + <span class="st" title="StringTok">'</span><span class="ch" title="CharTok">\'</span><span class="st" title="StringTok">'</span> + <span class="st" title="StringTok">' ->'</span>, abc(w, blocks)</code></pre></body>+ <span class="dt" title="DataTypeTok">print</span> <span class="st" title="StringTok">'</span><span class="ch" title="CharTok">\'</span><span class="st" title="StringTok">'</span> + w + <span class="st" title="StringTok">'</span><span class="ch" title="CharTok">\'</span><span class="st" title="StringTok">'</span> + <span class="st" title="StringTok">' ->'</span>, abc(w, blocks)</code></pre></div></body>
tests/abc.r.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">canMakeNoRecursion <-<span class="st" title="StringTok"> </span>function(x) {+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">canMakeNoRecursion <-<span class="st" title="StringTok"> </span>function(x) { x <-<span class="st" title="StringTok"> </span><span class="kw" title="KeywordTok">toupper</span>(x) charList <-<span class="st" title="StringTok"> </span><span class="kw" title="KeywordTok">strsplit</span>(x, <span class="kw" title="KeywordTok">character</span>(<span class="dv" title="DecValTok">0</span>)) getCombos <-<span class="st" title="StringTok"> </span>function(chars) {@@ -35,4 +36,4 @@ <span class="st" title="StringTok">"TREAT"</span>, <span class="st" title="StringTok">"COMMON"</span>, <span class="st" title="StringTok">"SQUAD"</span>,- <span class="st" title="StringTok">"CONFUSE"</span>))</code></pre></body>+ <span class="st" title="StringTok">"CONFUSE"</span>))</code></pre></div></body>
tests/abc.ruby.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,11 +16,11 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">words =<span class="ot" title="OtherTok"> %w(</span><span class="st" title="StringTok">A BaRK BOoK tREaT COmMOn SqUAD CoNfuSE</span><span class="ot" title="OtherTok">)</span> << <span class="st" title="StringTok">""</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">words =<span class="ot" title="OtherTok"> %w(</span><span class="st" title="StringTok">A BaRK BOoK tREaT COmMOn SqUAD CoNfuSE</span><span class="ot" title="OtherTok">)</span> << <span class="st" title="StringTok">""</span> words.each <span class="kw" title="KeywordTok">do</span> |word| blocks = <span class="st" title="StringTok">"BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM"</span> res = word.each_char.all?{|c| blocks.sub!(<span class="ot" title="OtherTok">/\w?#{</span>c<span class="ot" title="OtherTok">}\w?/i</span>, <span class="st" title="StringTok">""</span>)} <span class="co" title="CommentTok">#regexps can be interpolated like strings</span> puts <span class="st" title="StringTok">"</span><span class="ot" title="OtherTok">#{</span>word.inspect<span class="ot" title="OtherTok">}</span><span class="st" title="StringTok">: </span><span class="ot" title="OtherTok">#{</span>res<span class="ot" title="OtherTok">}</span><span class="st" title="StringTok">"</span> <span class="kw" title="KeywordTok">end</span>-</code></pre></body>+</code></pre></div></body>
tests/abc.scala.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">object</span> AbcBlocks <span class="kw" title="KeywordTok">extends</span> App {+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">object</span> AbcBlocks <span class="kw" title="KeywordTok">extends</span> App { <span class="kw" title="KeywordTok">protected</span> <span class="kw" title="KeywordTok">class</span> <span class="fu" title="FunctionTok">Block</span>(face1: Char, face2: Char) { @@ -64,4 +65,4 @@ <span class="co" title="CommentTok">//words(7).mkString.permutations.foreach(s => assert(isMakeable(s, blocks)))</span> words.<span class="fu" title="FunctionTok">foreach</span>(w => <span class="fu" title="FunctionTok">println</span>(s<span class="st" title="StringTok">"$w can${if (isMakeable(w, blocks)) "</span> <span class="st" title="StringTok">" else "</span>not <span class="st" title="StringTok">"}be made."</span>))-}</code></pre></body>+}</code></pre></div></body>
tests/abc.scheme.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode">#lang racket+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode">#lang racket (<span class="kw" title="KeywordTok">define</span><span class="fu" title="FunctionTok"> block-strings</span> (<span class="kw" title="KeywordTok">list</span> <span class="st" title="StringTok">"BO"</span> <span class="st" title="StringTok">"XK"</span> <span class="st" title="StringTok">"DQ"</span> <span class="st" title="StringTok">"CP"</span> <span class="st" title="StringTok">"NA"</span> <span class="st" title="StringTok">"GT"</span> <span class="st" title="StringTok">"RE"</span> <span class="st" title="StringTok">"TG"</span> <span class="st" title="StringTok">"QD"</span> <span class="st" title="StringTok">"FS"</span>@@ -57,4 +58,4 @@ (check-true (can-make-word? <span class="st" title="StringTok">"TREAT"</span>)) (check-false (can-make-word? <span class="st" title="StringTok">"COMMON"</span>)) (check-true (can-make-word? <span class="st" title="StringTok">"SQUAD"</span>))- (check-true (can-make-word? <span class="st" title="StringTok">"CONFUSE"</span>)))</code></pre></body>+ (check-true (can-make-word? <span class="st" title="StringTok">"CONFUSE"</span>)))</code></pre></div></body>
tests/abc.tcl.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">package</span> <span class="ot" title="OtherTok">require</span> Tcl <span class="fl" title="FloatTok">8.6</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok">package</span> <span class="ot" title="OtherTok">require</span> Tcl <span class="fl" title="FloatTok">8.6</span> <span class="kw" title="KeywordTok">proc</span> abc <span class="kw" title="KeywordTok">{</span>word <span class="kw" title="KeywordTok">{</span>blocks <span class="kw" title="KeywordTok">{</span>BO XK DQ CP NA GT RE TG QD FS JW HU VI AN OB ER FS LY PC ZM<span class="kw" title="KeywordTok">}}}</span> <span class="kw" title="KeywordTok">{</span> <span class="kw" title="KeywordTok">set</span> abc <span class="kw" title="KeywordTok">{{</span>letters blocks abc<span class="kw" title="KeywordTok">}</span> <span class="kw" title="KeywordTok">{</span>@@ -35,4 +36,4 @@ <span class="kw" title="KeywordTok">foreach</span> word <span class="kw" title="KeywordTok">{</span><span class="st" title="StringTok">""</span> A BARK BOOK TREAT COMMON SQUAD CONFUSE<span class="kw" title="KeywordTok">}</span> <span class="kw" title="KeywordTok">{</span> <span class="kw" title="KeywordTok">puts</span> <span class="kw" title="KeywordTok">[format</span> <span class="st" title="StringTok">"Can we spell %9s? %s"</span> '<span class="dt" title="DataTypeTok">$word</span>' <span class="kw" title="KeywordTok">[</span>abc <span class="dt" title="DataTypeTok">$word</span><span class="kw" title="KeywordTok">]]</span>-<span class="kw" title="KeywordTok">}</span></code></pre></body>+<span class="kw" title="KeywordTok">}</span></code></pre></div></body>
tests/archive.rhtml.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok"><h1></span>Event Archive<span class="kw" title="KeywordTok"></h1></span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="kw" title="KeywordTok"><h1></span>Event Archive<span class="kw" title="KeywordTok"></h1></span> <span class="kw" title="KeywordTok"><%</span> form_for <span class="st" title="StringTok">:to_date</span>, <span class="ot" title="OtherTok">@to_date</span>, <span class="st" title="StringTok">:url</span> <span class="ch" title="CharTok">=></span> <span class="ch" title="CharTok">{</span><span class="st" title="StringTok">:action</span> <span class="ch" title="CharTok">=></span> <span class="st" title="StringTok">'archive'</span><span class="ch" title="CharTok">}</span> <span class="kw" title="KeywordTok">do</span> <span class="ch" title="CharTok">|</span>f<span class="ch" title="CharTok">|</span> <span class="kw" title="KeywordTok">%></span>@@ -37,4 +38,4 @@ <span class="kw" title="KeywordTok"><%</span> <span class="kw" title="KeywordTok">end</span> <span class="kw" title="KeywordTok">%></span>-<span class="kw" title="KeywordTok"></ul></span></code></pre></body>+<span class="kw" title="KeywordTok"></ul></span></code></pre></div></body>
tests/life.lua.html view
@@ -1,4 +1,5 @@-<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {+<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">div.sourceCode { overflow-x: auto; }+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { margin: 0; padding: 0; vertical-align: baseline; border: none; } table.sourceCode { width: 100%; line-height: 100%; } td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }@@ -15,7 +16,7 @@ code > span.al { color: #ff0000; font-weight: bold; } code > span.fu { color: #06287e; } code > span.er { color: #ff0000; font-weight: bold; }-</style></head><body><pre class="sourceCode"><code class="sourceCode"><span class="co" title="CommentTok">-- life.lua</span>+</style></head><body><div class="sourceCode"><pre class="sourceCode"><code class="sourceCode"><span class="co" title="CommentTok">-- life.lua</span> <span class="co" title="CommentTok">-- original by Dave Bollinger </span><span class="kw" title="KeywordTok"><DBollinger</span><span class="ot" title="OtherTok">@compuserve.com</span><span class="kw" title="KeywordTok">></span><span class="co" title="CommentTok"> posted to lua-l</span> <span class="co" title="CommentTok">-- modified to use ANSI terminal escape sequences</span> <span class="co" title="CommentTok">-- modified to use for instead of while</span>@@ -125,4 +126,4 @@ <span class="kw" title="KeywordTok">end</span> <span class="kw" title="KeywordTok">end</span> -LIFE<span class="ot" title="OtherTok">(</span><span class="dv" title="DecValTok">40</span><span class="ot" title="OtherTok">,</span><span class="dv" title="DecValTok">20</span><span class="ot" title="OtherTok">)</span></code></pre></body>+LIFE<span class="ot" title="OtherTok">(</span><span class="dv" title="DecValTok">40</span><span class="ot" title="OtherTok">,</span><span class="dv" title="DecValTok">20</span><span class="ot" title="OtherTok">)</span></code></pre></div></body>