Skip to content

Commit

Permalink
split path catch all cases parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tatchi committed Jul 3, 2022
1 parent 08812bd commit 68a43ae
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lsp/src/uri_lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ and path = parse
| "" { { scheme = "file"; authority = ""; path = "/" } }
| "//" ([^ '/']* as authority) (['/']_* as path) { { scheme = "file"; authority; path } }
| "//" ([^ '/']* as authority) { { scheme = "file"; authority; path = "/" } }
| _* as path
{
let open Import in
{ scheme = "file"
; authority = ""
; path = String.add_prefix_if_not_exists path ~prefix:"/"
}
}
| ("/" _* as path) { { scheme = "file"; authority = ""; path } }
| (_* as path) { { scheme = "file"; authority = ""; path = "/" ^ path } }


{
let of_string s =
Expand Down

0 comments on commit 68a43ae

Please sign in to comment.