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

Single quote for type variables is sometimes intepreted as character literal #3

Open
tautologico opened this issue Dec 18, 2013 · 1 comment
Assignees

Comments

@tautologico
Copy link

In some contexts the single quote character for a type variable (e.g. 'T) is interpreted correctly and doesn't change the syntax highlighting, but there are contexts where it is interpreted incorrectly as a character literal, causing the highlighting to extend until the next single quote character. I'm using Sublime 3.0.

An example is the following piece of code:

let coinFlip (p : float) (d1 : Distribution<'T>) (d2 : Distribution<'T>) = 
    if p < 0.0 || p > 1.0 then failwith "invalid probability in coinFlip"
    { new Distribution<'T> with 
          member d.Sample = 
              if rnd.NextDouble() < p then d1.Sample else d2.Sample 
          member d.Support = Set.union d1.Support d2.Support
          member d.Expectation(H) = 
              p * d1.Expectation(H) + (1.0 - p) * d2.Expectation(H) }

The type variables in the first line are interpreted correctly, but the one in the third line causes the rest of the code to be colorized as a character literal.

@ghost ghost assigned hoest Dec 20, 2013
@DerTee
Copy link

DerTee commented Sep 26, 2018

The issue is still there. The OCaml Syntax highlighting does not have the same problem, the highlighting works as expected:
2018-09-26_14-51-52

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

3 participants