unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Aurélien Aptel" <aurelien.aptel@gmail.com>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: SMIE examples and questions
Date: Thu, 25 Jun 2020 11:21:18 +0200	[thread overview]
Message-ID: <CA+5B0FMWFC+z34gi3kJa2RdGN1Tg1Le4w+FjKiQymu2xkf6Few@mail.gmail.com> (raw)

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!



             reply	other threads:[~2020-06-25  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25  9:21 Aurélien Aptel [this message]
2020-06-25 16:54 ` SMIE examples and questions Stefan Monnier
2020-07-31 14:42   ` Aurélien Aptel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+5B0FMWFC+z34gi3kJa2RdGN1Tg1Le4w+FjKiQymu2xkf6Few@mail.gmail.com \
    --to=aurelien.aptel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).