From: Nikolai Weibull <now@disu.se>
To: Emacs Users <help-gnu-emacs@gnu.org>
Subject: Using smie for Relax NG compact syntax
Date: Mon, 9 Feb 2015 16:49:30 +0100 [thread overview]
Message-ID: <CADdV=MtZQ-OZ-J5EXwdZoJBDXjVKiT2nv_J_xD=KNn-mPf_EAg@mail.gmail.com> (raw)
Hi!
I’m trying to set up a grammar for Relax NG’s compact syntax and am
trying to get something as simple as
element a {
empty
}
to work, but I’m not succeeding:
(unless rnc-mode-syntax-table
(setq rnc-mode-syntax-table (make-syntax-table))
(modify-syntax-entry ?\{ "(}" rnc-mode-syntax-table)
(modify-syntax-entry ?\} "){" rnc-mode-syntax-table))
(defconst rnc-mode-smie-grammar
(smie-prec2->grammar
(smie-bnf->prec2
'((id)
(pattern ("element" id "{" pattern "}") ("empty"))))))
and
(defun rnc-mode-smie-rules (kind token)
(pcase (cons kind token)
(`(:elem .basic) rnc-indent-level)))
rnc-mode-smie-forward-token and rnc-mode-smie-backward-token are
basically smie-default-forward-token and smie-default-backward-token.
The indentation after a { at the end of a line doesn’t agree with the
rules at all and I can’t understand why. The keyword “element” is
being highlighted as show-paren-mismatch, which I also don’t
understand, as there’s a whole pattern in
element a {
empty
}
Any obvious issues here?
next reply other threads:[~2015-02-09 15:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 15:49 Nikolai Weibull [this message]
2015-02-09 16:56 ` Using smie for Relax NG compact syntax Stefan Monnier
2015-02-10 7:17 ` Nikolai Weibull
2015-02-10 20:13 ` Stefan Monnier
2015-02-11 7:55 ` Nikolai Weibull
2015-02-11 15:54 ` Stefan Monnier
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='CADdV=MtZQ-OZ-J5EXwdZoJBDXjVKiT2nv_J_xD=KNn-mPf_EAg@mail.gmail.com' \
--to=now@disu.se \
--cc=help-gnu-emacs@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.
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).