From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: SMIE examples and questions Date: Thu, 25 Jun 2020 11:21:18 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="55562"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 25 11:22:06 2020 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 1joO56-000EKD-G8 for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Jun 2020 11:22:04 +0200 Original-Received: from localhost ([::1]:43696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joO55-0002Qo-Gv for ged-emacs-devel@m.gmane-mx.org; Thu, 25 Jun 2020 05:22:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joO4b-00020b-Qt for emacs-devel@gnu.org; Thu, 25 Jun 2020 05:21:33 -0400 Original-Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:45948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1joO4a-0002KM-8k for emacs-devel@gnu.org; Thu, 25 Jun 2020 05:21:33 -0400 Original-Received: by mail-io1-xd2a.google.com with SMTP id e64so351418iof.12 for ; Thu, 25 Jun 2020 02:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=nT/O8Vsk9K57s19I1u2czNKQNw03Zauo7+udEAL4/wU=; b=o2D5ja7ZLwgo7BBvkDQHkEDdxMWw2UNdET4dR0+idZqoDc9ja+aNmIobLBrUfId9kK 2wu2sp0CnznxzOqGnDGJVZipog+Q5EcbNNK2HS6ZPvm7FsaWS8Ov71iyQJv9jwZ4WSJg 6u2M5ESgm3qDEGMjIObe/nbUewodL4LrY9AcOj+IS6zuOaz6JxDI3GLaFnMQR/odU9iP EpMhMCwVmvD5weRRbtycEbfkzbJOPaouL66OK/X7bjKGH7Uj0wyMmAIUaybaRkWvMObs x/r+O1S8+frlVum/JJETHuF7rOpaYPOkVIfFu9J8RE7pf23r+8H+WE0ZYMlAEH0fWGGe WAHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nT/O8Vsk9K57s19I1u2czNKQNw03Zauo7+udEAL4/wU=; b=dG08lzTvbVg31hBMCYlesmAqrygZJPwQTjWNmyaJAVFzQag1YiiVAXY5XH0px+O2N3 26lJBaI4VmUrvON1RUuN3Zo8VyOEU9XoYoRxMaCUWAwoF3uZKmme7LtANtAuG7T7WXiP 0WUfAThZrSb+TqgYBjQbbAt+kZ9YGkwz4Ku6uQO19Lo66/OT4SRbKjdZ5Ga4PQuaEpD/ 5fVA+tF34WVhnoQ+1KlFfQwMIEwK9qiH4VTE50X6AozvtEnQYLD7OAEXwpSfXNXCn8xk L30wYP/0lTa9qWuMNbBwMsG2xSOAkYRuIrLl8fyawOPjSgBuJpV1MYXrCWbk5UhZkVb5 fOdw== X-Gm-Message-State: AOAM533A85awXYCRlT47J7oxTosIdirEQX5xnvp5up10xS3Vs06oJbyK BnDLktxIURdYq07rCfyEdF6dy6CshQZGyRDlgxQZlcDKmkE= X-Google-Smtp-Source: ABdhPJx/QgdDHZjEWpGKu3P9UZjVBqTHKhn8CeGThTQJMGRd0ERKJzJvl77sxmhDBk1Q8I0jx62s6tK1yJeJzUErlX0= X-Received: by 2002:a05:6638:236:: with SMTP id f22mr18940318jaq.18.1593076889893; Thu, 25 Jun 2020 02:21:29 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::d2a; envelope-from=aurelien.aptel@gmail.com; helo=mail-io1-xd2a.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=_AUTOLEARN 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:252533 Archived-At: Hi, Are there *simple* complete examples of SMIE out there? I find the manual not that helpful to get started and existing modes look pretty complex :( Is the forward lexer required or is the backward one enough? What are the assumptions of SMIE regarding the lexer? - What should it return when there is nothing to read (eg backward and begining of buffer)? - I assume if the point is in the middle of a token, it should return the complete current token (including text after point) and place the point at token start? - Does point position matter regarding spaces (assuming they have no meaning)? Is it ok if the lexer places the point sometime after and sometime before them? - Can I safely call it manually without involving SMIE? - I assume backward and forward lexer should always have the same behaviour, even for spaces? I understand there is no way to dump the AST after parsing, and that grammar errors not being reported is a feature. How am I supposed to debug parsing/indenting? If you have any tips or workflow, like the more practical order to implement things, or how to debug that would be greatly appreciated. Thanks!