Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This commit fixes ticket universal-ctags#300 (improper handling of ';;' at toplevel) and universal-ctags#355 (error on parsing empty file). But more importantly, it adds support for: proper function recognition (kinda) let rec ... and ... module [rec] M : sig ... end = struct ... end module [rec] M = struct ... end and N = struct ... end Most of these changes required a single-token lookahead, so I added this to all of the parsing functions. It's now used rather prolifically. Function discovery relies upon the assumption that most people write functions like let [rec] my_func a b c = ... or let [rec] my_func () = ... or let [rec] () = ... let [rec] _ = ... Still unsupported are things such as let [rec] my_func = function MyCon1 -> ... | MyCon2 ... let [rec] my_func = fun a b c d -> ... The first would require two-token lookahead, while last would require an n-token lookahead. Although, support _may_ be able to be added by using a 'functionValidation' function similar to constructorValidation. Something to look into.
- Loading branch information