presentations/highlight-js/test/detect/ocaml/default.txt

24 lines
637 B
Text
Raw Normal View History

2018-12-07 08:48:05 -06:00
(* This is a
multiline, (* nested *) comment *)
type point = { x: float; y: float };;
let some_string = "this is a string";;
let rec length lst =
match lst with
[] -> 0
| head :: tail -> 1 + length tail
;;
exception Test;;
type expression =
Const of float
| Var of string
| Sum of expression * expression (* e1 + e2 *)
| Diff of expression * expression (* e1 - e2 *)
| Prod of expression * expression (* e1 * e2 *)
| Quot of expression * expression (* e1 / e2 *)
class point =
object
val mutable x = 0
method get_x = x
method private move d = x <- x + d
end;;