unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* modify-syntax-entry with single and two character comments
@ 2004-10-27 17:55 Spike Ilacqua
  2004-10-27 19:11 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Spike Ilacqua @ 2004-10-27 17:55 UTC (permalink / raw)


I'm trying to build a syntax table for a language that as two comment 
modes.  "|" starts a single line comment, and works like "#" in Perl. 
"|* ... *|" can contain a comment and may be multiple lines, basically 
the same a C's "/* ... */".  I've tried a number of variations and the 
closest I get is:

     (modify-syntax-entry ?\n ">" st)
     (modify-syntax-entry ?\| "<1b4b" st)
     (modify-syntax-entry ?\* ".2b3b" st)


which works for "|* ... *|" and recognizes "|" as the start of a comment 
but doesn't see a newline as the end of a comment that starts with "|". 
  This on the other hand:

     (modify-syntax-entry ?\n ">b" st)
     (modify-syntax-entry ?\| "<b14" st)
     (modify-syntax-entry ?\* ".23" st)

Doesn't recognize the "|* .. *|" comments.  Any suggestions on how to 
make this work?

One note, I have:

      (list "\\(||\\)" 1 '(1 . nil))

in the font-lock-syntactic-keywords to make sure that "||" isn't treated 
as a comment.  But I don't think that's part of the problem.


Thanks,
->Spike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-27 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-27 17:55 modify-syntax-entry with single and two character comments Spike Ilacqua
2004-10-27 19:11 ` Stefan Monnier
2004-10-27 20:16   ` Stefan Monnier

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).