<%= link_to post.title, post %>
+<% end %> + +<%- available_things = things.select(&:available?) -%> +<%%- x = 1 + 2 -%%> +<%% value = 'real string #{@value}' %%> +<%%= available_things.inspect %%> diff --git a/src/test/__fixtures__/erlang-repl.txt b/src/test/__fixtures__/erlang-repl.txt new file mode 100644 index 0000000..8f2bef3 --- /dev/null +++ b/src/test/__fixtures__/erlang-repl.txt @@ -0,0 +1,27 @@ +1> Str = "abcd". +"abcd" +2> L = test:length(Str). +4 +3> Descriptor = {L, list_to_atom(Str)}. +{4,abcd} +4> L. +4 +5> b(). +Descriptor = {4,abcd} +L = 4 +Str = "abcd" +ok +6> f(L). +ok +7> b(). +Descriptor = {4,abcd} +Str = "abcd" +ok +8> {L, _} = Descriptor. +{4,abcd} +9> L. +4 +10> 2#101. +5 +11> 1.85e+3. +1850 diff --git a/src/test/__fixtures__/erlang.txt b/src/test/__fixtures__/erlang.txt new file mode 100644 index 0000000..528e064 --- /dev/null +++ b/src/test/__fixtures__/erlang.txt @@ -0,0 +1,60 @@ +-module(ssh_cli). + +-behaviour(ssh_channel). + +-include("ssh.hrl"). +%% backwards compatibility +-export([listen/1, listen/2, listen/3, listen/4, stop/1]). + +if L =/= [] -> % If L is not empty + sum(L) / count(L); +true -> + error +end. + +%% state +-record(state, { + cm, + channel + }). + +-spec foo(integer()) -> integer(). +foo(X) -> 1 + X. + +test(Foo)->Foo. + +init([Shell, Exec]) -> + {ok, #state{shell = Shell, exec = Exec}}; +init([Shell]) -> + false = not true, + io:format("Hello, \"~p!~n", [atom_to_list('World')]), + {ok, #state{shell = Shell}}. + +concat([Single]) -> Single; +concat(RList) -> + EpsilonFree = lists:filter( + fun (Element) -> + case Element of + epsilon -> false; + _ -> true + end + end, + RList), + case EpsilonFree of + [Single] -> Single; + Other -> {concat, Other} + end. + +union_dot_union({union, _}=U1, {union, _}=U2) -> + union(lists:flatten( + lists:map( + fun (X1) -> + lists:map( + fun (X2) -> + concat([X1, X2]) + end, + union_to_list(U2) + ) + end, + union_to_list(U1) + ))). diff --git a/src/test/__fixtures__/excel.txt b/src/test/__fixtures__/excel.txt new file mode 100644 index 0000000..3ec724d --- /dev/null +++ b/src/test/__fixtures__/excel.txt @@ -0,0 +1 @@ +=IF(C10 <= 275.5, "Unprofitable", "Profitable") \ No newline at end of file diff --git a/src/test/__fixtures__/fix.txt b/src/test/__fixtures__/fix.txt new file mode 100644 index 0000000..e93a625 --- /dev/null +++ b/src/test/__fixtures__/fix.txt @@ -0,0 +1,4 @@ +8=FIX.4.2␁9=0␁35=8␁49=SENDERTEST␁56=TARGETTEST␁34=00000001526␁52=20120429-13:30:08.137␁1=ABC12345␁11=2012abc1234␁14=100␁17=201254321␁20=0␁30=NYSE␁31=108.20␁32=100␁38=100␁39=2␁40=1␁47=A␁54=5␁55=BRK␁59=2␁60=20120429-13:30:08.000␁65=B␁76=BROKER␁84=0␁100=NYSE␁111=100␁150=2␁151=0␁167=CS␁377=N␁10000=SampleCustomTag␁10=123␁ + +8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123 + \ No newline at end of file diff --git a/src/test/__fixtures__/flix.txt b/src/test/__fixtures__/flix.txt new file mode 100644 index 0000000..77d7f1a --- /dev/null +++ b/src/test/__fixtures__/flix.txt @@ -0,0 +1,49 @@ +/** + * An example of Flix for syntax highlighting. + */ + +// Here is a namespace. +namespace a.b.c { + + // Here are some literals. + def b: Bool = true + def c: Char = 'a' + def f: Float = 1.23 + def i: Int = 42 + def s: Str = "string" + + // Here are some relations. + rel LitStm(r: Str, c: Int) + rel AddStm(r: Str, x: Str, y: Str) + rel DivStm(r: Str, x: Str, y: Str) + + // Here is a lattice. + lat LocalVar(k: Str, v: Constant) + + // Here is an index. + index LitStm{{r}, {r, c}} + + // Here is an enum. + enum Constant { + case Top, + + case Cst(Int), + + case Bot + } + + // Here is a function. + def leq(e1: Constant, e2: Constant): Bool = match (e1, e2) with { + case (Constant.Bot, _) => true + case (Constant.Cst(n1), Constant.Cst(n2)) => n1 == n2 + case (_, Constant.Top) => true + case _ => false + } + + // Here are some rules. + LocalVar(r, alpha(c)) :- LitStm(r, c). + + LocalVar(r, sum(v1, v2)) :- AddStm(r, x, y), + LocalVar(x, v1), + LocalVar(y, v2). +} diff --git a/src/test/__fixtures__/fortran.txt b/src/test/__fixtures__/fortran.txt new file mode 100644 index 0000000..1d41b40 --- /dev/null +++ b/src/test/__fixtures__/fortran.txt @@ -0,0 +1,22 @@ +subroutine test_sub(k) + implicit none + + !=============================== + ! This is a test subroutine + !=============================== + + integer, intent(in) :: k + double precision, allocatable :: a(:) + integer, parameter :: nmax=10 + integer :: i + + allocate (a(nmax)) + + do i=1,nmax + a(i) = dble(i)*5.d0 + enddo + + print *, 'Hello world' + write (*,*) a(:) + +end subroutine test_sub diff --git a/src/test/__fixtures__/fsharp.txt b/src/test/__fixtures__/fsharp.txt new file mode 100644 index 0000000..b7a0031 --- /dev/null +++ b/src/test/__fixtures__/fsharp.txt @@ -0,0 +1,48 @@ +open System + +// Single line comment... +(* + This is a + multiline comment. +*) +let checkList alist = + match alist with + | [] -> 0 + | [a] -> 1 + | [a; b] -> 2 + | [a; b; c] -> 3 + | _ -> failwith "List is too big!" + + +let text = "Some text..." +let text2 = @"A ""verbatim"" string..." +let catalog = """ +Some "long" string... +""" + +let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2) + +let fibs = + Async.Parallel [ for i in 0..40 -> async { return fib(i) } ] + |> Async.RunSynchronously + +type Sprocket(gears) = + member this.Gears : int = gears + +[