...

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

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

     1// This is a single line comment.
     2/* A multi line comment, in a single line... */
     3/* This is a multi line comment
     4   Second Line...
     5*/
     6/* This is a nested comment
     7  /* Nested Line... */
     8*/
     9
    10module Process_Bind_Without_Do =
    11       (W: Monad_Bind with type m('a) = writer(string, 'a)) => {
    12  let process = s => W.(up_case(s) >>= (up_str => to_words(up_str)));
    13};
    14
    15let a = 1 or 2;
    16let b = 1 || 2;
    17let c = 1 && 2;
    18
    19let str = "Hello, Lexer!";
    20
    21let chr = 'a';
    22
    23type test;
    24
    25open Belt;
    26
    27include Pervasives;
    28
    29let test: unit => Map.String.t(string) = () => Map.String.empty;
    30
    31let tup = (1: int, 2: int);
    32
    33let myRec = {x: 0, y: 10};
    34
    35let myFuncs = {
    36  myFun: (x) => x + 1,
    37  your: (a, b) => a + b
    38};
    39
    40let lst = [1, 2, 3];
    41
    42let logRest = (lst) => 
    43  switch (lst) {
    44    | [] => Js.log("no entry")
    45    | [hd, ...rest] => Js.log2("Rest: ", rest);
    46  };
    47
    48let arr = [|1, 2, 3|];
    49
    50let res = (x) =>
    51  switch (x) {
    52  | HasNothing => 0
    53  | HasSingleInt(x) => 0
    54  | HasSingleTuple((x, y)) => 0
    55  | HasMultipleInts(x, y) => 0
    56  | HasMultipleTuples((x, y), (q, r)) => 0
    57  };
    58
    59module View = {
    60  [@react.component]
    61  let make = () => {
    62    <div className="view"> 
    63      <ul>
    64      <li> React.string("Hello, World!") </li>
    65      <li> "pipe"->React.string </li>
    66      <li> <span> "nested"->React.string </span> </li>
    67      </ul>
    68    </div>
    69  }
    70}

View as plain text