...

Text file src/github.com/alecthomas/chroma/v2/lexers/testdata/sml.actual

Documentation: github.com/alecthomas/chroma/v2/lexers/testdata

     1signature S = sig
     2    datatype t = Hoge | Fuga
     3end
     4
     5structur A = struct
     6  structure B = struct
     7    structure C = struct
     8      type t = int * real * string * bool ref
     9    end
    10  end
    11end
    12
    13functor F(X:sig type t; val compare: t * t -> order): S = struct
    14  datatype t = Hoge | Fuga
    15end
    16
    17structure Main = struct
    18  local
    19      structure M = F(Int)
    20      open M
    21  in
    22    fun id x = x
    23    val bool = if true then false orelse false else true andalso true
    24    val int = ~1 + 1
    25    val real = 0.7 - 0.32E5 * E3~7
    26    val string = "a\a\b\t\n\v\f\r\^M\097\u00a1\"\\\
    27                 \"
    28    (* (* comments *) *)
    29    val ## = 1
    30    val |=| = 2
    31    infix ##
    32    infixr ##
    33    val op## = case Hoge of
    34                   Hoge => Fuga
    35                | Fuga => Hoge
    36    type s = {1: t, label: unit}
    37    type u = A.B.C.t
    38    val s = {1 = Hoge, label = ()}
    39    fun id x = x
    40    val rec id = fn x => x
    41    exception X and Y
    42    raise X handle X => (nil, [1], [1, 2])
    43  end
    44end

View as plain text