From e54b7e9eb24dee67a902d2906241f523ffd9f2ea Mon Sep 17 00:00:00 2001 From: Milo Davis Date: Thu, 14 Dec 2017 12:37:12 +0100 Subject: [PATCH] Micheline: fixes bug in resilient parser --- lib_micheline/micheline_parser.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib_micheline/micheline_parser.ml b/lib_micheline/micheline_parser.ml index 27c054c49..814df9136 100644 --- a/lib_micheline/micheline_parser.ml +++ b/lib_micheline/micheline_parser.ml @@ -499,7 +499,8 @@ let rec parse ?(check = true) errors tokens stack = | Open_paren -> Close_paren | Open_brace -> Close_brace | _ -> assert false } in - parse ~check errors (fake :: (* insert *) tokens) stack + let tokens = token :: (* insert *) fake :: List.tl tokens in + parse ~check errors tokens stack (* Valid states *) | (Toplevel _ | Sequence (_, _, _)) :: _ , { token = Ident name ; loc } :: { token = Annot annot } :: rest ->