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: Tue, 21 Sep 2021 15:20:36 -0700 Message-ID: <7447C582-70CB-4599-BC76-AD5687D64250@gmail.com> References: <83r1f7hydn.fsf@gnu.org> <83r1dselyo.fsf@gnu.org> <6A4CE984-6ACE-4E66-8EF2-F3D351C02248@gmail.com> <83r1dscpt2.fsf@gnu.org> <83o88wcof9.fsf@gnu.org> <83lf3zdh4z.fsf@gnu.org> <8965C4A0-79D3-4D77-A6BA-D07A6C93F7FE@gmail.com> <83ilz3cs4k.fsf@gnu.org> <04D19C1A-CD64-4156-B932-1C9FEEE4EC7B@gmail.com> <83zgsebc0r.fsf@gnu.org> <1F752923-F357-4A18-B6E2-0120F1B9BD37@gmail.com> <83fsu5bzem.fsf@gnu.org> <83zgsdad5j.fsf@gnu.org> <83sfy391ni.fsf@gnu.org> <03386E3C-A975-4ECD-BF89-6AC62F751725@gmail.com> <83ilyz8xdl.fsf@gnu.org> <86czp6ukpj.fsf@stephe-leake.org> <1AEED8A5-BF5E-45E5-AE22-9B405A710F9B@gmail.com> <83czp313tf.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8132"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?utf-8?B?VHXhuqVuLUFuaCBOZ3V54buFbg==?= , Theodor Thornhill , =?utf-8?Q?Cl=C3=A9ment_Pit-Claudel?= , Emacs developers , Stefan Monnier , Eli Zaretskii , Stephen Leake To: John Yates Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Sep 22 00:21:28 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 1mSo8l-0001w6-9P for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Sep 2021 00:21:27 +0200 Original-Received: from localhost ([::1]:37898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSo8k-0007cG-0J for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 18:21:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSo89-0006ri-Vy for emacs-devel@gnu.org; Tue, 21 Sep 2021 18:20:50 -0400 Original-Received: from mail-qv1-xf32.google.com ([2607:f8b0:4864:20::f32]:44647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSo81-0001ID-Eb; Tue, 21 Sep 2021 18:20:46 -0400 Original-Received: by mail-qv1-xf32.google.com with SMTP id 11so660571qvd.11; Tue, 21 Sep 2021 15:20:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Kf+KwfIOUwKLbDe0zdzudkomk04d8X+pXnKfDh2y1ic=; b=F7TpDmYq13EsdnMnqLt7hfz+obSR1zO7XHgEiikp5BaHUrUpU1iVlvuXPdKhxsATz9 qwoJ14gQ9CdvsE3qxobubSBbI8uSBYfnIhwslJajE0HfxJ/TgKGHjULyrokbeW78pvKA 93EVEjpcl7fA+CO0NwL/smuxCh2qwvMLvjjOMAUeRwrFVWLWk3uNfK2AMaSqv/9WJFNH VYZBZX8+yje681v8nvh+NZ4SHmjwWuGFBsGXF+XE0Z9pm8zJ8A8YqCl5HsbUC5iAf0b3 aLl8rtTgbHrZOGUWX0p5e+IxfSutoQJbBeicAt9IZDMGGJr1SazJci40GVygkt/v2nO5 EyoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Kf+KwfIOUwKLbDe0zdzudkomk04d8X+pXnKfDh2y1ic=; b=3AEk0nyK8SvgMW7GNRs+57lNuECUw4by2bp6LmwUNoklLnI8WoQE9thTQaHCrv0vyk G/C13SHDH0PThdDFeXqhCgxm5W1CLS0HDakDLXonBWtGvO/yk0s31t7Ghitr5n4be/x5 i1zJ/+9v8LUOqJ2F5BqNaA2RKyDKNIB+JQ/Y/psh9T0/MWXb68Iy9AYcvg4GIA+jpfrk +kyHs7wDt8kk0gJSjWpOC6tqCVCSMFHjr67PMI9g1kPi8NvaYgKBIVgjo4DyPf6JhWuQ 7XjI71kNz+f10PLC0/DXQ7pjtl37yWVENXmTlmKFob+v+fAyymcOBbXECzgeqdFrQLDI bqBw== X-Gm-Message-State: AOAM530sFBCCQEhJgxwSnzFW7RU/0jMlAeDV/MHc1n2xJj091NdKvbxk 1amyGHXB4okY0yTzTRX24bM= X-Google-Smtp-Source: ABdhPJykTb6rSMyu3n4e3/LDXPqQ0yhtX6ZEiMBaLV7UKmehl9v9nXXmTweBhkqCjfooBcnC/puspw== X-Received: by 2002:a0c:b40e:: with SMTP id u14mr19033781qve.34.1632262838877; Tue, 21 Sep 2021 15:20:38 -0700 (PDT) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c9f:753b:ac0f:fda7:2b6b]) by smtp.gmail.com with ESMTPSA id d78sm270773qkg.92.2021.09.21.15.20.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Sep 2021 15:20:38 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.13) Received-SPF: pass client-ip=2607:f8b0:4864:20::f32; envelope-from=casouri@gmail.com; helo=mail-qv1-xf32.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:275277 Archived-At: > On Sep 20, 2021, at 12:09 PM, John Yates wrote: > > Maybe: > > Anonymous nodes are usually tokens composed of > punctuation characters like quote @samp{"} and > auto-increment @samp{++}, or distinguished identifiers > with fixed spellings used as keywords, like @code{return}. > > /John Thanks, John and Eli. I modified it to Names like @code{root}, @code{expression}, @code{number}, @code{operator} are nodes' @dfn{type}. However, not all nodes in a syntax tree have a type. Nodes that don't are @dfn{anonymous nodes}, and nodes with a type are @dfn{named nodes}. Anonymous nodes are tokens with fixed spellings, including punctuation characters like bracket @samp{]}, and keywords like @code{return}. Yuan