Variable: semantic-lex-spp-paren-or-list
semantic-lex-spp-paren-or-list is a variable defined in lex-spp.el.gz.
Value
((looking-at "\\s(")
(if
(or (not semantic-lex-maximum-depth)
(< semantic-lex-current-depth semantic-lex-maximum-depth))
(progn
(setq semantic-lex-current-depth
(1+ semantic-lex-current-depth))
(semantic-lex-push-token
(semantic-lex-token 'open-paren (match-beginning 0)
(match-end 0))))
(save-excursion
(let
((start (match-beginning 0)) (end (match-end 0))
(peom (save-excursion (c-end-of-macro) (point))))
(condition-case nil
(progn
(forward-list 1) (when (> (point) peom) (error ""))
(semantic-lex-push-token
(semantic-lex-token 'semantic-list start (point))))
(error
(semantic-lex-push-token
(semantic-lex-token 'open-paren start end))))))))
Documentation
Detect open parenthesis.
Contrary to semantic-lex-paren-or-list(var)/semantic-lex-paren-or-list(fun), this will push a single
open-paren onto the stream if no closing paren can be found.
This is important for macros which open a scope which is closed
by another macro.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/lex-spp.el.gz
(define-lex-regex-analyzer semantic-lex-spp-paren-or-list
"Detect open parenthesis.
Contrary to `semantic-lex-paren-or-list', this will push a single
open-paren onto the stream if no closing paren can be found.
This is important for macros which open a scope which is closed
by another macro."
"\\s("
(if (or (not semantic-lex-maximum-depth)
(< semantic-lex-current-depth semantic-lex-maximum-depth))
(progn
(setq semantic-lex-current-depth (1+ semantic-lex-current-depth))
(semantic-lex-push-token
(semantic-lex-token
'open-paren (match-beginning 0) (match-end 0))))
(save-excursion
(let ((start (match-beginning 0))
(end (match-end 0))
(peom (save-excursion (c-end-of-macro) (point))))
(condition-case nil
(progn
;; This will throw an error if no closing paren can be found.
(forward-list 1)
(when (> (point) peom)
;; If we have left the macro, this is the wrong closing
;; paren, so error out as well.
(error ""))
(semantic-lex-push-token
(semantic-lex-token
'semantic-list start (point))))
(error
;; Only push a single open-paren.
(semantic-lex-push-token
(semantic-lex-token
'open-paren start end))))))))