From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id EC5D8BBC4 for ; Thu, 2 Apr 2009 14:58:52 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkCAH5T1EnUGyoClGdsb2JhbACWGQEBAQEJCwgJEQO5OYN8Bg X-IronPort-AV: E=Sophos;i="4.39,314,1235948400"; d="scan'208";a="23808165" Received: from smtp2-g21.free.fr ([212.27.42.2]) by mail2-smtp-roc.national.inria.fr with ESMTP; 02 Apr 2009 14:58:52 +0200 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 1A7AA4B013A; Thu, 2 Apr 2009 14:58:46 +0200 (CEST) Received: from [192.168.17.1] (ivr94-8-88-162-26-239.fbx.proxad.net [88.162.26.239]) by smtp2-g21.free.fr (Postfix) with ESMTP id 2720B4B0121; Thu, 2 Apr 2009 14:58:44 +0200 (CEST) Message-ID: <49D4B6DB.2020407@users.sourceforge.net> Date: Thu, 02 Apr 2009 15:00:11 +0200 From: Zheng Li User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b4pre) Gecko/20090401 Lightning/1.0pre Shredder/3.0b3pre MIME-Version: 1.0 To: Conglun Yao Cc: caml-list@yquem.inria.fr Subject: Re: How to achieve this camlp4 syntax extension References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; camlp:01 syntax:01 'list':01 longident:01 2009:98 sourceforge:01 parsed:01 wrote:01 pps:01 jussieu:01 expression:02 defined:02 match:02 module:03 scope:04 On 4/2/2009 1:42 PM, Conglun Yao wrote: > > Different kinds of error happened, when trying to use it. > > Even the ordinary expression: List.length [1; 2;3 ], failed. 'List' > is parsed as module_longident, try to match the rule I defined. > > Thanks for any help. > > Conglun You may have a look at the source code of my pa_scope [1]. It deals with these issues and support both open scope (via @) and closed scope (via .{}, .[], .()). The code is just ~50 lines. HTH. [1] http://www.pps.jussieu.fr/~li/software/index.html#pa_scope -- Zheng