summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorian Hammerschmidt <florianh89@gmail.com>2020-02-29 15:47:15 +0100
committerGitHub <noreply@github.com>2020-02-29 15:47:15 +0100
commit0922530959cebfdb3a75dcae244d50e12a1b2052 (patch)
tree22ffff7cb00ecbe9119c0b9c1042b0d71b13d3e9 /tests
parent35544e2fc6eed0ce4a27ec7285aac71ff0ddc473 (diff)
downloadpygments-git-0922530959cebfdb3a75dcae244d50e12a1b2052.tar.gz
Add ReasonML lexer. (#1386)
Diffstat (limited to 'tests')
-rw-r--r--tests/examplefiles/test.re70
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/examplefiles/test.re b/tests/examplefiles/test.re
new file mode 100644
index 00000000..8f74ff4a
--- /dev/null
+++ b/tests/examplefiles/test.re
@@ -0,0 +1,70 @@
+// This is a single line comment.
+/* A multi line comment, in a single line... */
+/* This is a multi line comment
+ Second Line...
+*/
+/* This is a nested comment
+ /* Nested Line... */
+*/
+
+module Process_Bind_Without_Do =
+ (W: Monad_Bind with type m('a) = writer(string, 'a)) => {
+ let process = s => W.(up_case(s) >>= (up_str => to_words(up_str)));
+};
+
+let a = 1 or 2;
+let b = 1 || 2;
+let c = 1 && 2;
+
+let str = "Hello, Lexer!";
+
+let chr = 'a';
+
+type test;
+
+open Belt;
+
+include Pervasives;
+
+let test: unit => Map.String.t(string) = () => Map.String.empty;
+
+let tup = (1: int, 2: int);
+
+let myRec = {x: 0, y: 10};
+
+let myFuncs = {
+ myFun: (x) => x + 1,
+ your: (a, b) => a + b
+};
+
+let lst = [1, 2, 3];
+
+let logRest = (lst) =>
+ switch (lst) {
+ | [] => Js.log("no entry")
+ | [hd, ...rest] => Js.log2("Rest: ", rest);
+ };
+
+let arr = [|1, 2, 3|];
+
+let res = (x) =>
+ switch (x) {
+ | HasNothing => 0
+ | HasSingleInt(x) => 0
+ | HasSingleTuple((x, y)) => 0
+ | HasMultipleInts(x, y) => 0
+ | HasMultipleTuples((x, y), (q, r)) => 0
+ };
+
+module View = {
+ [@react.component]
+ let make = () => {
+ <div className="view">
+ <ul>
+ <li> React.string("Hello, World!") </li>
+ <li> "pipe"->React.string </li>
+ <li> <span> "nested"->React.string </span> </li>
+ </ul>
+ </div>
+ }
+} \ No newline at end of file