-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for ocaml syntax highlighting
- Loading branch information
Showing
13 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(* ok *) | ||
exception E = F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
(* ok *) | ||
module M : sig | ||
module type F | ||
= functor () (X : Ord) -> sig end | ||
module F | ||
: functor () (X : Ord) -> sig end | ||
end | ||
= struct | ||
module type F | ||
= functor () (X : Ord) -> sig end | ||
module F | ||
: functor () (X : Ord) -> sig end | ||
= functor () (X : Ord) -> struct end | ||
end | ||
|
||
module type F | ||
= functor () (X : Ord) -> sig end | ||
module F | ||
: functor () (X : Ord) -> sig end | ||
= functor () (X : Ord) -> struct end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(* https://github.com/ocaml/vim-ocaml/issues/3 *) | ||
|
||
module Make (M : sig end) = struct module type S = sig end end | ||
module Test : Make(Make(Int)).S = struct end | ||
(* ----------------^ the inner modules are linted as constructors *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Make : functor(X: Ord) -> sig | ||
module Bar : module type of Make(X) | ||
|
||
val x : int | ||
val y : int | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module M : sig | ||
module F () (X : Ord) : sig end | ||
end | ||
= struct | ||
module F () (X : Ord) : sig end = struct end | ||
end | ||
|
||
module F () (X : Ord) : sig end = struct end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module M0 : sig end = struct let x = 0 end | ||
(* => linting of struct is correct *) | ||
|
||
module M1 : sig end = (struct let x = 0 end : sig end) | ||
(* => linting of struct is correct | ||
(but linting of last sig is buggy because of the type linter of PR#76) *) | ||
|
||
module M2 = (struct let x = 0 end : sig end) | ||
(* => ^^^^^^^^^^^^^^^^^^^^ | ||
the whole struct is linted with a wrong, uniform style | ||
(but linting of last sig is correct) *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(* https://github.com/ocaml/vim-ocaml/issues/6 *) | ||
|
||
module IM = Stdlib.Map.Make(Int) | ||
(* ^^^^^^^^^^^^^^^^^^^^ | ||
shown as a module/functor, with a uniform style *) | ||
|
||
module IM : sig end = Stdlib.Map.Make(Int) | ||
(* ^^^^^^^^^^^^^^^^^^^^ | ||
shown as as an expression (a datatype constructor `Make` | ||
prefixed with a module path, and a constructor `Int`) *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(* https://github.com/ocaml/vim-ocaml/issues/84 *) | ||
(* Foo is highlighted incorrectly *) | ||
type x = (module Foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(* approximately ok: | ||
* - "module type of" linted as ocamlKeyword | ||
* - "F" linted as ocamlModule | ||
* - "(X)" linted meaninglessly but by chance it doesn’t look SO bad | ||
*) | ||
module N : module type of F(X) | ||
|
||
module M : sig | ||
module N : module type of X | ||
module N : module type of F(X) | ||
val x : int | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(* ok *) | ||
module _ = struct | ||
let () = () | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module F : Bar = Foo | ||
|
||
module Test : Make(Int).S = struct end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
(* https://github.com/ocaml/vim-ocaml/issues/88 *) | ||
(* foo is highlighted incorrectly on every line *) | ||
val bar : [>foo] | ||
let decode x = (Dns.Packet.decode x : (_, Dns.Packet.err) result :> (_, [> foo]) result) | ||
type t = [Dns.Packet.foo | Dns.Packet.bar] |
File renamed without changes.