From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yoav Marco Newsgroups: gmane.emacs.devel Subject: Re: Tree-sitter integration on feature/tree-sitter Date: Thu, 30 Jun 2022 17:37:58 +0300 Message-ID: <87v8sib48b.fsf@gmail.com> References: <87tu83pbth.fsf@gmail.com> <87y1xeb93m.fsf@gmail.com> <87k08ygr6y.fsf@meain.io> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33218"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.3; emacs 29.0.50 Cc: Abin Simon , casouri@gmail.com, eliz@gnu.org, theo@thornhill.no, monnier@iro.umontreal.ca, dancol@dancol.org, emacs-devel@gnu.org To: Abin Simon Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 30 17:54:28 2022 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 1o6wUu-0008TN-2t for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jun 2022 17:54:28 +0200 Original-Received: from localhost ([::1]:37506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6wUt-0004N0-4n for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jun 2022 11:54:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6vPN-0001sA-Mx for emacs-devel@gnu.org; Thu, 30 Jun 2022 10:44:41 -0400 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:34473) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6vPM-0003pE-3i; Thu, 30 Jun 2022 10:44:41 -0400 Original-Received: by mail-ej1-x635.google.com with SMTP id d2so27729204ejy.1; Thu, 30 Jun 2022 07:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=2DXtfAFap+7wwr4y4SKenhXhcFjQ6805vhtwjnqKbg8=; b=KdD4WCquPyNcHU83B0wQSpYoM0TWo00pNFI2Ygiut1Yf0cQP+wohMLUCKKhOZ3IqkO W5bAzF0HR14BQA6KHEcC7ewYZn3usOH45w4RlX/A8VMbZ2O2Ls1SrgS7HUT9Fdz701Rx lwxxWBnOLxm2apnTbtWjak28t92I8NlHBfpsUVJjDUdfWVLKmBE3Du7aRD2rIBjjYjuw z1XVqzLHIudgnC596ubANteP3OVxt7B0bp1jpytthz1cZ7AXYPOTc8XEmOY/G5gG7zdj 10532SYX4vakIklTDf9JAPkxQ26ihAvB/LkhH6L8irGM7YDGHGF/H9pY2zS0Ogjgb3mi 4p1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=2DXtfAFap+7wwr4y4SKenhXhcFjQ6805vhtwjnqKbg8=; b=n0qnfEBDtRgjgA9kn5Pt4QwxIRMWdsnX5OuJx7PUx1teWd+72Zsah/O0Xn4hsvy1OP GXdD+D92fZgxh3ndA0IiQzQP/4FvZlwQN/VtDpgZqaJc5YVqRwaDSAfphCW8qDPV0xiQ GlWwxVU1AOMfs9IQkv9qxa0htjydyPV3HXBHkqnZXE4iuqeL9Pe47Ol7+vmtOT7hbYSb 2vjaf+v8x+Hgh/iaSZI366D48Ra5nB14TqSr6DxUcDM6qQUS+RsnJSmJ0R4cYsKcIn4q RL6hvcVLZz08Q6FKABFhWEbM6Qhw45SgaxVgDwspKsFaREzYDDeH6psZhQ+KM8IWU+Yp 1Sng== X-Gm-Message-State: AJIora9fxHIMGN/z6RsJl7Am0aYukFbaw29xkIoYijGTfVbyQrgJJ4FU ipeA671MNCAU1dNIu8nY7Xs= X-Google-Smtp-Source: AGRyM1uB0krw1lCcEwr3i13MrprCIoLRXdupeblSWtJOW9s5INms+q+qXNbQyeLzf72KbXvtA4baZA== X-Received: by 2002:a17:907:2e0d:b0:72a:5c99:8853 with SMTP id ig13-20020a1709072e0d00b0072a5c998853mr3911295ejc.689.1656600278097; Thu, 30 Jun 2022 07:44:38 -0700 (PDT) Original-Received: from localhost ([2a0d:6fc0:2817:d700:159d:ab98:95d7:9918]) by smtp.gmail.com with ESMTPSA id fi9-20020a170906da0900b00722e5b234basm9229511ejb.179.2022.06.30.07.44.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 07:44:37 -0700 (PDT) In-reply-to: <87k08ygr6y.fsf@meain.io> Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=yoavm448@gmail.com; helo=mail-ej1-x635.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 30 Jun 2022 11:53:23 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:291749 Archived-At: Abin Simon writes: >> I see you wrote a go program to pre-process #make-range!. I also had to do >> something similar in >> https://github.com/emacs-tree-sitter/tree-sitter-langs/pull/99 >> due to predicate incompatibility, though I do it in Elisp right after >> reading the query file. So I guess it's a valid solution too. > > Ahh, that makes sense. I just went with go just because I was bit more > confortable writing the "parser" in go. Ah, well I cheated :) I ran a regexp on the query to replace # with \#, and then the whole query is a valid elisp sexp, so I read it to a list with `read' and recursively parsed *that*. Makes for very pretty code IMO. Yoav