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=2.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL 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 25F3CBC37 for ; Wed, 1 Jul 2009 04:13:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmEBAJhiSkrRVd22mGdsb2JhbACYRD8BAQEBAQgJDAcTpTuBGpAuAQMCBIQLBQ X-IronPort-AV: E=Sophos;i="4.42,320,1243807200"; d="scan'208";a="29051657" Received: from mail-qy0-f182.google.com ([209.85.221.182]) by mail2-smtp-roc.national.inria.fr with ESMTP; 01 Jul 2009 04:13:04 +0200 Received: by qyk12 with SMTP id 12so47980qyk.1 for ; Tue, 30 Jun 2009 19:13:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=G2nTxN4D4MSeFAQLo+fumF1BHG2BG7Lc36VlWu2qL18=; b=FOx83bu9Hl28+3ZE9EIfftAOgUWVxFtihB0fcHki3VS/E0OyLX3S5YElLz3WcCaJDM eKdobedULl7Uzbzu9GN+yuNvB/EPZwR/JXpo8dw7YGYXarl7YPEZ+pIh5FD5eBOuOsrR KnaZYdD5gFDsSPlgKwd1EFUfaeE/niqqkyUjw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=FsCBfaNbOopiTo9eJM+xzdgvaoIywSZR27jintD4mOCcIRtt7mnvFPlGXp/H2Ss6cm rhCDyJNnt5qaketV0ecG60fJsnzcDLCg2E26GIcrCmflZ8EsLsjbu0snjEl0E1dZIbA4 yqfLz1Ey5O11hGQGnoYZ0/oJuVkabEuHt/4pk= MIME-Version: 1.0 Received: by 10.220.90.3 with SMTP id g3mr5504274vcm.20.1246414383440; Tue, 30 Jun 2009 19:13:03 -0700 (PDT) In-Reply-To: <1750DDE9-4FC6-4657-9687-58240F520A70@mpi-sws.org> References: <7d8707de0906110557n6a1511a2k9f4f00827f954cb6@mail.gmail.com> <4A310A5B.9010404@ens-lyon.org> <7d8707de0906120120x10cc8fe0p54adbd189003f3da@mail.gmail.com> <1750DDE9-4FC6-4657-9687-58240F520A70@mpi-sws.org> Date: Tue, 30 Jun 2009 22:13:03 -0400 Message-ID: <2a1a1a0c0906301913t1dce3eebie91c7cc94f015481@mail.gmail.com> Subject: Re: [Caml-list] ocamllex and python-style indentation From: Mike Lin To: Andreas Rossberg Cc: Yitzhak Mandelbaum , Andrej Bauer , caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocamllex:01 rossberg:01 rossberg:01 literals:01 literals:01 tokens:01 ocaml:01 2009:98 wrote:01 wrote:01 andreas:01 caml-list:01 parentheses:01 lex:01 lex:01 On Tue, Jun 30, 2009 at 6:06 PM, Andreas Rossberg wrote: > On Jun 30, 2009, at 22.19 h, Mike Lin wrote: >> >> More generally, you've got parentheses, comments, and string literals, >> and you need to know to ignore whitespace within any of those -- and >> to ignore e.g. an open parenthesis that occurs within a comment, or a >> close comment that occurs within a string literal. So inevitably >> you've got to lex and parse at some level to make this work for a >> practical language. > > Comments and string literals are no problem, since the lex wrapper will > never see anything inside them as separate tokens anyway. OCaml comments can be nested, and must be nested parenthetically. :)