all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Defining syntactic symbols
@ 2003-03-20 21:03 Peter Lee
  2003-03-20 22:35 ` Peter Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Lee @ 2003-03-20 21:03 UTC (permalink / raw)


Hello all.

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.

Any help would be greatly appreciated.

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

* Re: Defining syntactic symbols
  2003-03-20 21:03 Defining syntactic symbols Peter Lee
@ 2003-03-20 22:35 ` Peter Lee
  2003-03-20 23:08   ` Peter Lee
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Lee @ 2003-03-20 22:35 UTC (permalink / raw)


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

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

* Re: Defining syntactic symbols
  2003-03-20 22:35 ` Peter Lee
@ 2003-03-20 23:08   ` Peter Lee
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Lee @ 2003-03-20 23:08 UTC (permalink / raw)


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?

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

end of thread, other threads:[~2003-03-20 23:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20 21:03 Defining syntactic symbols Peter Lee
2003-03-20 22:35 ` Peter Lee
2003-03-20 23:08   ` Peter Lee

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.