From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter api Date: Wed, 18 Aug 2021 14:30:37 -0700 Message-ID: <8B7F80FE-56EF-482D-BFA7-66ADA2B6B304@gmail.com> References: <83r1f7hydn.fsf@gnu.org> <95F37923-5BF9-4D81-B361-267CF119FBCA@gmail.com> <735AF34C-FD18-4A6A-A99D-E5D8EB4DE4F3@gmail.com> <86im02bobr.fsf@stephe-leake.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25608"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Theodor Thornhill , Stefan Monnier , =?utf-8?Q?Cl=C3=A9ment_Pit-Claudel?= , emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 18 23:46:14 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGTO1-0006Nv-4U for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Aug 2021 23:46:13 +0200 Original-Received: from localhost ([::1]:53544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGTNz-0008LB-Nr for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Aug 2021 17:46:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGT90-0000QN-CU for emacs-devel@gnu.org; Wed, 18 Aug 2021 17:30:42 -0400 Original-Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:38638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGT8y-0006g1-Pl; Wed, 18 Aug 2021 17:30:42 -0400 Original-Received: by mail-pj1-x1031.google.com with SMTP id om1-20020a17090b3a8100b0017941c44ce4so9840430pjb.3; Wed, 18 Aug 2021 14:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K32aJbx2scoF8xafbSY6gmUcFZSdVWxN6Ah93GJJnEQ=; b=tpSo98gNdNfqJndqZV+COpifESkg3PoWxLNWV/0PlGVUs4akUf+LNnxX06d66mH+6P E3b/QV0M3Ld5B+SoU9hqvrQLz4K3x+pJl4jyWqs4DqIYLh7OaCHzdRfg59AUhf/YAWoy lAeYUa/KPUHuz5IUdNV1OfH4cQ5OX0Ru/inEk/ZiDv0RP550pmYGmd/126comW4P2tvI /v+2digbKwecP6FaNsftT+bh2G+YqrJlPtTJQlob+eflRKFhop9825AZI52PYMxjhDK9 /vR4OO3o9XrIsLa499YsCVkL6iSGptjpLHiSDlgXyWsRxQEwDY5uqKgD1zVI54V9J7W4 cqPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=K32aJbx2scoF8xafbSY6gmUcFZSdVWxN6Ah93GJJnEQ=; b=jGSutkTHAZMpK3x1/WnXDG7pvNuEwO4aglFwhR5DhfVjeNxo+ebsXNDmRju+hX/Ig8 0YQ3HCPfwa/5T7whj0HNvP78zByx7GZi1TjFsC1DmHkoVbTAXlG7WS6iQk9xQQnHnBGQ xdiYCMw/zGe+pkkKc4lzHJenHyO1sKeC++louXNv7p3KPyKv1U16IYLLbEMAfJxPHRht tqNuaHLVtmkUkppfjGutAHBThcG8lRdtX0f1V84oh/fIwpV0SvU8WauA2GSBVy8YZnFU wFi29DEsmhTmM70rJ172k7oCAVh1EW/AnV73YA+gwL5a+fTGivsUg7C2DypuMmOzef8Q yIvw== X-Gm-Message-State: AOAM531OLIRJZC5KNUDPQhS1zUxxp5dWtMlxp4J0XQZ4E0gIJMwhi8ce 6zLJWqwnOr2YKOaKHWoce4Q= X-Google-Smtp-Source: ABdhPJwthflq+dT9wl7ENGJUC2R5JVmPQLEXzdKB+KMhOg1FdAdfPZikUI7lJaqK8WZLfqTSu0KzrQ== X-Received: by 2002:a17:902:a705:b029:12b:71be:d24e with SMTP id w5-20020a170902a705b029012b71bed24emr8959573plq.29.1629322239064; Wed, 18 Aug 2021 14:30:39 -0700 (PDT) Original-Received: from 2603-8000-d900-871b-bc08-2e1a-6bdb-e376.res6.spectrum.com (2603-8000-d900-871b-bc08-2e1a-6bdb-e376.res6.spectrum.com. [2603:8000:d900:871b:bc08:2e1a:6bdb:e376]) by smtp.gmail.com with ESMTPSA id y19sm753712pfe.71.2021.08.18.14.30.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Aug 2021 14:30:38 -0700 (PDT) In-Reply-To: <86im02bobr.fsf@stephe-leake.org> X-Mailer: Apple Mail (2.3654.60.0.2.21) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=casouri@gmail.com; helo=mail-pj1-x1031.google.com 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-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272622 Archived-At: >=20 > This looks very interesting, but I have a migraine right now, so I'll > have to look at it later. Hope you get better soon :-) > You could try writing indent rules for Ada; current ada-mode code is = in > https://savannah.nongnu.org/git/?group=3Dada-mode. See the test/ = directory > for examples of known good indentation. >=20 > ada-mode takes the approach of embedding the indent rules directly in > the grammar, and the functions that do that provide a few more options > than yours. To see the definition of those functions, you'll have to > install the wisi package, and look in wisi.info, section Grammar > actions. (it would be nice if that info/html file was linked from the > GNU ELPA package page; I'll start a new thread for that). Thanks. I=E2=80=99ll see what I can do; I know nearly nothing about Ada = except that it is commissioned by the department of defense :-) BTW, while I was reading the manual, I noticed a typo: If token labels are used in a right hand side, they must be given explicitly in the indent arguments, using he lisp "cons" ^ syntax. Labels are normally only used with EBNF grammars, which expand into multiple right hand sides, with optional tokens simply left out. Explicit labels on the indent arguments allow them to be left out as well. Yuan