Questions tagged [smie]

SMIE (Simple Minded Indentation Engine) is a package that provides a generic navigation and indentation engine. Based on a very simple parser using an “operator precedence grammar”, it lets major modes extend the sexp-based navigation of Lisp to non-Lisp languages as well as provide a simple to use but reliable auto-indentation.

4 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
0answers
704 views

How do I parse a simple grammar and obtain a syntax tree in Emacs lisp?

How can I construct a parse tree from a string and a simple grammar? Semantic seems very tricky, and SMIE does not seem to produce a parse tree. Here's an example, assuming a language that looks like ...
7
votes
2answers
636 views

Do not align nested calls when using ruby-smie

When using the newly added ruby formatting functionality I face the following problem: I would really like for my rspec code to be formatted like the following: it do is_expected.to match(/\[Error\...
2
votes
0answers
133 views

SMIE default syntax : First level of indentation

When you only do that in your major mode : (require 'smie) (smie-setup nil #'ignore) That means SMIE but no grammar, and no rules. And it's great. It makes the point stay on col0 when you TAB and ...
1
vote
0answers
12 views

How does SMIE mode determine what the parent of a token is?

I'm writing indentation rules for a custom mode using SMIE. I want to use smie-rule-parent-p to have different behavior for indenting an empty line depending on context, so inside my indentation ...