From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aCc1LHBNl18MWwAA0tVLHw (envelope-from ) for ; Mon, 26 Oct 2020 22:28:00 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cJ4yKHBNl1/UDQAA1q6Kng (envelope-from ) for ; Mon, 26 Oct 2020 22:28:00 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 54694940917 for ; Mon, 26 Oct 2020 22:28:00 +0000 (UTC) Received: from localhost ([::1]:39522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kXAy6-0006S7-L6 for larch@yhetil.org; Mon, 26 Oct 2020 18:27:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXAqR-00016E-Ji for emacs-orgmode@gnu.org; Mon, 26 Oct 2020 18:20:03 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:55175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kXAqP-0007Wi-Cu; Mon, 26 Oct 2020 18:20:03 -0400 Received: by mail-wm1-x336.google.com with SMTP id w23so12091615wmi.4; Mon, 26 Oct 2020 15:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aDRqZ8XlDS6h9nXpY0Bv1mR9ik3+phGh6M8WImNINa0=; b=ZaGTP1THSF7SyQNxqR+k0dT58P9oR8UZ90jQt641e0Rn1lteCq5fTIC3+d/s5PI1M5 JPy/9LYs5gnoW4qAa0s3bYahnBH5Eby/NQvEo4nf4R7c3iIUCllt2V7UJi7SzTwOX3Xz MBj6Fc5flQKl+jE7D3H0WEUM3kXVwC/w1DTXE+cCgwXxDHrzFVvJMmXXtgDYALgaMrBc buis4OIItRcxIgbBVNOF/6kL3/bb0q8QkpJ6ZzhL4aBGZjv2byGjtMbqVAyl4jFhFnhD sLLIq223d9y16eA8+VmnqUz0yMPmKXnxENoGLUbmSZCXlhlWdLG0D73k9/KJPGTjrVJn bClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aDRqZ8XlDS6h9nXpY0Bv1mR9ik3+phGh6M8WImNINa0=; b=BRpACCFJQcqfBf3ZjNKpUnWscCzBCAkh4McA0vLQ3hvEgN10AzPlvhK/tGnXCTonTv 1lMo+6f6J8ixYDk9goOdFa5+y6u506uAAd5kxVch5yR5tQ7XDWvuh/03WpMrVn6JhT9q kWoLnDLJMLGgkWGW+kY+mYckmo4fz1wnhKJxBZjDbozV9m+j2w311De3hY+aK8DDn/OI EsFmw3479L2vdWhrUAOE417JqeSDJEr+JaY34iI36LnGesJZTWcbpjmHgwri6wsW6uBc p6aconlCSqMrv3nGjqXJdZrRnejG8S5WjAXhamupjr0sQhr64ELkXBFPNCfYovhqcGnI blfg== X-Gm-Message-State: AOAM531Yp2rq+E3AYhpKhN/CgGcFj2Bj+rLCDoXxpv31SEs9WDr4USjS pK2BcAV1SUpkjTRyaqJNiMDR4y9F3mjqpw6EuTs= X-Google-Smtp-Source: ABdhPJxDvzdU8+8UUxzlDmq/Y1X8iFK064t21qvUA/XIzYy/k7sGweA32+maB/Hl7LK/68qDSf6DH0UL+yfeapzVGUQ= X-Received: by 2002:a1c:a541:: with SMTP id o62mr18128249wme.90.1603750799301; Mon, 26 Oct 2020 15:19:59 -0700 (PDT) MIME-Version: 1.0 References: <68dc1ea1-52e8-7d9e-fb2d-bcf08c111eca@intrepidus.pl> <874kno7w3v.fsf@gnu.org> <87k0vdkz7c.fsf@gmail.com> <87sga13w62.fsf@nicolasgoaziou.fr> <87r1plj71v.fsf@gmail.com> <87mu093qgn.fsf@nicolasgoaziou.fr> <87o8kpj5mu.fsf@gmail.com> <874kmgka3l.fsf@gmail.com> <87r1pkis8d.fsf@gmail.com> In-Reply-To: <87r1pkis8d.fsf@gmail.com> From: Tom Gillespie Date: Mon, 26 Oct 2020 18:19:47 -0400 Message-ID: Subject: Re: official orgmode parser To: Ken Mankoff Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=tgbugs@gmail.com; helo=mail-wm1-x336.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , =?UTF-8?B?UHJ6ZW15c8WCYXcgS2FtacWEc2tp?= , emacs-orgmode , Nicolas Goaziou Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=ZaGTP1TH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: 8wpIlPIxBBFx Even if this did work for plain lists it won't work for headlines because headlines have an arbitrary number of stars and thus it is not possible for the grammar to know what is a sub-headline vs "the next headline". For a similar reason I'm fairly sure that the sublist approach will not work due to issues with relative indent. Here is the quote from the current draft syntax. > An item ends before the next item, the first line less or equally indented > than its starting line, or two consecutive empty lines. Indentation of lines > within other greater elements do not count, neither do inlinetasks boundaries. The "the first line less or equally indented than its starting line" section is what prevents your approach from working because you have to know the relative indentation in order to figure out which list contains a nested list. As written your grammar will parse a nested list into a flat list. This is because there are an arbitrary number distinct tokens that could be =indent= in your grammar and the EBNF can't specify an ordering for them so that you can't say that one indent is greater than another. For list termination the rule seems to be two new lines followed by not a list element. As a result of this, my inclination is to only parse plain list elements and reconstruct the whole "list" only as an internal semantic. Check the behavior of 1. to 1. see 1. what 1. I 1. mean 1. 1. 1.