Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCaml syntax highlighting with struct surround with parentheses #6

Open
ghost opened this issue Jan 1, 2016 · 2 comments
Open

OCaml syntax highlighting with struct surround with parentheses #6

ghost opened this issue Jan 1, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 1, 2016

Here is a piece of syntax which is not properly handled:

module type X_int = sig val x : int end

module Four: X_int = struct
  let x = 4
end

Four.x

module Three = (struct
  let x = 3
end: X_int)

Three.x

Which looks like:
screen shot 2016-01-01 at 8 10 07 pm

@Maelan
Copy link
Contributor

Maelan commented Jul 22, 2022

I confirm this bug. Here is a minimal example:

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) *)

@Maelan
Copy link
Contributor

Maelan commented Nov 1, 2022

A related discrepancy:

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`) *)

It’s just the fact that = does not follow module IM immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant