fsprojects / zarchive-sublime-fsharp-package

F# development tools for SublimeText 3
32 stars 7 forks source link

Syntax highlighting: Strange output #1

Closed rojepp closed 8 years ago

rojepp commented 9 years ago

I haven't looked at why this happens yet. Code is from https://github.com/fsharp/FSharp.AutoComplete/blob/master/FSharp.CompilerBinding/Parser.fs

  let sequence (P p) (P q) = P (fun inp -> 
    [ for (pr, inp') in p inp do
        for (qr, inp'') in q inp' do 
          yield (pr, qr), inp''])
  let sat p = parser { 
    let! v = item 
    if (p v) then return v }
  let char x = sat ((=) x)
  let digit = sat Char.IsDigit    
  let lower = sat Char.IsLower
  let upper = sat Char.IsUpper
  let letter = sat Char.IsLetter
  let nondigit = sat (Char.IsDigit >> not)
  let whitespace = sat (Char.IsWhiteSpace)
  let alphanum = parser { 
    return! letter
    return! digit }  
  let rec word = parser {
    return []
    return! parser {
      let! x = letter
      let! xs = word
      return x::xs } }
  let string (str:string) = 
    let chars = str.ToCharArray() |> List.ofSeq
    let rec string' = function
      | [] -> result []
      | x::xs -> parser { 
          let! y = char x
          let! ys = string' xs 
          return y::ys }
guillermooo commented 9 years ago

We'll be switching to .sublime-syntax soon and tmLanguage will be a thing of the past. Perhaps it's best to close this one out.

guillermooo commented 9 years ago

Closing this.