Eric M. Ludlam wrote:
>>>>Thomas Geffert <tgf-news2003@...> seems to think that:
>>
>>Hello,
>>
>>I cannot get semantic to parse my C/C++ files correctly with XEmacs.
[...]
> Punctuation symbols like HASH are placed into a punctuation symbol
> table. In the case of C the hash regexp looks like this: "\\b[#]\\b"
>
> This regexp is then spliced directly into the grammar for the C
> language. (The wisent parser has a better mechanism.)
>
> Two things to try as an experiment are these:
>
> 1) Test the regexp:
> * put cursor on the # in the #include.
> * M-: (looking-at "\\b[#]\\b") RET
> -- should return t
This doesn't work, it returns nil. But it works on a = with M-:
(looking-at "\\b[=]\\b") RET. But the equal sign is not recognized by
the parser, too.
> 2) Test string-match on the regexp.
> * from anywhere in the C file
> * M-: (string-match "\\b[#]\\b" "#") RET
> -- should return 0
It returns nil too, even width the # replaced by = .
It works with (string-match "\\b[#]\\b" "x#x") which returns correctly
1, So it seems that \b doesn't recognize a word boundary on string
start/end.
The documentation of my Emacs21 explains \b in the same way as the
XEmacs documentation, but adds:
| `\b' matches at the beginning or end of the buffer regardless of
| what text appears next to it.
This sentence is missing in the XEmacs regexp documentation.
I'm wondering if this doesn't work only with my XEmacs or if it is
rather a general XEmacs problem.
Do you have any ideas how to solve this problem?
Thanks for your help,
Thomas
|