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

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

Re: Defining syntactic symbols


From: Peter Lee
Subject: Re: Defining syntactic symbols
Date: Thu, 20 Mar 2003 23:08:55 GMT
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

Peter Lee <pete_lee/remove-for-email/@swbell.net> writes:

> Peter Lee <pete_lee/remove-for-email/@swbell.net> writes:
> 
> > I'm having a problem with cc-mode handling things macros inside class
> > definitions such as DECLARE_MESSAGE_MAP(class).
> > 
> > I'm having the same problem with csharp-mode and attributes such as
> > [ComVisible(true)]
> > [Guid("6674C3CF-1118-40f2-B7F2-CBA3D863082C")]
> > 
> > Following either of these the indentation is off or in the case of
> > csharp I get syntactic errors.
> > 
> > If I put a semi-colon after the attributes or the macro's the problem
> > goes away.
> > 
> > I assume I need to extend cc-mode to handle this syntax, but I'm not
> > sure how to go about it.
> 
> I wanted to add that I'm using the following for csharp support:
> 
> ;;; csharp-mode.el --- csharp-mode
> ;; Authors: 2002 Dennis Haney <davh@davh.dk>
> ;;          2000 Brad Merrill <zbrad@cybercom.net>
> ;; Version: 1.05

More info, I found the following in csharp-mode.el that looks to be
what I need to change:

(defconst c-Csharp-attrib-key (concat "\[" c-symbol-key "\\(([^)]*)\\)?\]"))

(defconst c-Csharp-class-key
  (concat
   c-Csharp-attrib-key
  "\\(?:" 
   "\\("
   "new\\|"
   "public\\|"
   "protected\\|"
   "internal\\|"
   "private\\|"
   "abstract\\|"
   "sealed"
   "\\)"
   "\\s +\\)*"
   "\\(struct\\|class\\)\\s +"
   c-symbol-key                         ;name of the class
   "\\(\\s *:\\s *" c-symbol-key        ;maybe followed by parent
   "\\(\\s *,\\s *" c-symbol-key "\\)*"
   "\\)?"
   ))

I'm guessing I just need to change the regex for c-Csharp-attrib-key
to be able to handle recognize:

[ComVisible(true)]
[Guid("6674C3CF-1118-40f2-B7F2-CBA3D863082C")]

But all my attempts so far have not been successful. If any regex
gurus out there can help it would be appreciated.

Or is the completely wrong place to be doing this?


reply via email to

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