]> git.eshelyaron.com Git - emacs.git/commit
Expand preprocessor to handle macros which open or close scope.
authorDavid Engster <dengste@eml.cc>
Sun, 27 Oct 2013 21:13:46 +0000 (22:13 +0100)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 15:59:25 +0000 (17:59 +0200)
commit6945c33baa7934a7a1a79735399f7e34b0ece627
tree03910069285371ef6d3aa678da1c47c74a56c317
parentf916b8f7d40ee0c3e60bc228317f2069a3d76561
Expand preprocessor to handle macros which open or close scope.

* semantic/lex-spp.el (semantic-c-end-of-macro): Declare.
(semantic-lex-spp-token-macro-to-macro-stream): Deal with macros which
open/close a scope.  For this, leave an overlay if we encounter a
single open paren and return a semantic-list in the lexer.  When this
list gets expanded, retrieve the old position from the overlay.  See
the comments in the function for further details.
(semantic-lex-spp-find-closing-macro): New function to find the next
macro which closes scope (i.e., has a closing paren).
(semantic-lex-spp-replace-or-symbol-or-keyword): Go to end of closing
macro if necessary.
(semantic-lex-spp-paren-or-list): New lexer to specially deal with
parens in macro definitions.

* bovine/c.el (semantic-cpp-lexer): Use new
`semantic-lex-spp-paren-or-list'.

* tests/cedet/semantic/test/manual/cedet/testsppreplace.c:
* tests/cedet/semantic/test/manual/cedet/testsppreplaced.c: Add tests for the
above.
test/manual/cedet/cedet/semantic/tests/testsppreplaced.c