help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

modify-syntax-entry with single and two character comments


From: Spike Ilacqua
Subject: modify-syntax-entry with single and two character comments
Date: Wed, 27 Oct 2004 11:55:22 -0600
User-agent: Mozilla Thunderbird 0.8 (Windows/20040913)

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]