From f5d7a3847bceed48bfe429a43524aad305e9d8cc Mon Sep 17 00:00:00 2001 From: vberthoux Date: Thu, 25 Oct 2012 20:19:48 +0000 Subject: [PATCH] Handling let rec .. = ... and ... declarations at top level. git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@795 c5d04d22-be80-434c-894e-aa346cc9e8e8 --- Test/ocamlAllKinds.ml | 7 +++++++ ocaml.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Test/ocamlAllKinds.ml b/Test/ocamlAllKinds.ml index 9a9edf1..17643a9 100644 --- a/Test/ocamlAllKinds.ml +++ b/Test/ocamlAllKinds.ml @@ -16,6 +16,13 @@ let (+-) a b = in (aplus, aminus) +let shall_appear () = + let sub_not 1 = 2 + and shall_not_either fu = () in + let nope = 3 +and must_appear_also 4 = () + + let foo_function a b = (a, b) class fooClass = diff --git a/ocaml.c b/ocaml.c index 362bc82..b5264e6 100644 --- a/ocaml.c +++ b/ocaml.c @@ -1732,8 +1732,14 @@ static void localScope (vString * const ident, ocaToken what) break; case OcaKEYWORD_and: - popLastNamed (); - toDoNext = &localLet; + popSoftContext (); + if (toDoNext != &mayRedeclare) + toDoNext(ident, what); + else + { + pushEmptyContext(localScope); + toDoNext = &localLet; + } break; case OcaKEYWORD_else: