From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 759127F7B4 for ; Thu, 13 Feb 2014 23:07:34 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.44 as permitted sender) identity=mailfrom; client-ip=209.85.214.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f44.google.com) identity=helo; client-ip=209.85.214.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f44.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnYCAElB/VLRVdYslWdsb2JhbABZhBW/TYESCBYOAQEBAQcNCQkSKoIlAQEFJxkBGx0BAwwGBQsNLiEBAREBBQEcBhOHcAEDEZoqjF6DDpUlChknDWSHWBEBBQyMU4IaB4Q4AQOWQIFsjF6DWBgphFo7 X-IPAS-Result: AnYCAElB/VLRVdYslWdsb2JhbABZhBW/TYESCBYOAQEBAQcNCQkSKoIlAQEFJxkBGx0BAwwGBQsNLiEBAREBBQEcBhOHcAEDEZoqjF6DDpUlChknDWSHWBEBBQyMU4IaB4Q4AQOWQIFsjF6DWBgphFo7 X-IronPort-AV: E=Sophos;i="4.95,840,1384297200"; d="scan'208";a="49000638" Received: from mail-bk0-f44.google.com ([209.85.214.44]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Feb 2014 23:07:33 +0100 Received: by mail-bk0-f44.google.com with SMTP id mz12so3296273bkb.3 for ; Thu, 13 Feb 2014 14:07:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=5+lVeOG90/sdelMMWdjfoNwrw2saEheG19imLInxo/E=; b=DoHLczs31KHd4KJw96OyM46O1Ga26/NnYblpujivZCrMBYdmJVjhjxCA9IPtFnUrJ5 aGpiEQXs7lUr46UzVCqQfFkd/5zhhrI4vQu3FnUbb8svil040viqTjoDxafu3sK17CBk q7NW31LVMP6Uvdt9pNBUv0nc7I420pgeR1meLStovLaTCAjekUWyRBAtkECbq8MPeYn1 q0OyOtCve3CjjaCfmaDn61hqYyaiSC4zk7LEU2kJo+kvQkG80rHPXGVLtAa2prDxircw Q7caVlIXwveH5xeAlSwuW0zJmHJ9S+oQUX+5fPbkQrnHVVl1x8Ru9KGmWJEWVCJzI/XS glgg== X-Received: by 10.205.25.6 with SMTP id rg6mr3658071bkb.10.1392329253192; Thu, 13 Feb 2014 14:07:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.205.45.5 with HTTP; Thu, 13 Feb 2014 14:06:53 -0800 (PST) In-Reply-To: References: From: Gabriel Scherer Date: Thu, 13 Feb 2014 23:06:53 +0100 Message-ID: To: Ashish Agarwal Cc: Caml List Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] menhir types cannot be open polymorphic variant Workaround 1: in another file (this won't work in the menhir header) type 'a start = [> `Got_int ] as 'a then use ('a start) instead of [> `Got_int ]. Workaround 2: apply the patch below to the most recent menhir sources diff -ru menhir-20130911.old/src/lexer.mll menhir-20130911.new/src/lexer.mll --- menhir-20130911.old/src/lexer.mll 2013-09-11 08:58:39.000000000 +0200 +++ menhir-20130911.new/src/lexer.mll 2014-02-13 23:05:19.240180035 +0100 @@ -344,7 +344,7 @@ of O'Caml variant types, but we ignore that possibility for the moment. *) and ocamltype openingpos = parse -| "->" +| "->" | "[>" { ocamltype openingpos lexbuf } | '>' { OCAMLTYPE (Stretch.Declared (mk_stretch true openingpos (lexeme_start_p lexbuf) [])) } On Thu, Feb 13, 2014 at 9:55 PM, Ashish Agarwal wrote: > $ cat parser.mly > %token INT > %start <[> `Got_int]> main > %% > main: INT {`Got_int} > > $ menhir parser.mly > File "parser.mly", line 2, characters 11-11: > Error: unexpected character(s). > > If I make the type exact [`Got_int], it works fine. Is there any way to get > around this? I need an open type. >