[Github-comments] [geany] c++: Fix parsing of C++11 raw string literals (#879)

Colomban Wendling notifications at xxxxx
Sat Jan 23 20:54:31 UTC 2016


See http://en.cppreference.com/w/cpp/language/string_literal

Closes #877.

---

This contains a pretty ugly hack to fetch the previous character, in
order not to get fooled by string concatenation hidden behind a macro,
like in `FOUR"five"`, which is not a raw string literal but simply the
identifier `FOUR` followed by the string `"five"`.

While this may sound uncommon, it is not and lead to complaints [2][3]
when Scintilla [1] broke this when they introduced C++11 raw string
literal support themselves.

The implementation here still contains a bug with line continuations: a
raw literal of the form:

```c
const char *str = R\
"xxx(...)xxx";
```

is not properly recognized as such, although it's perfectly valid (yet
probably very uncommon).  For the record, Scintilla has also suffers
from this but nobody complained about it yet.

[1] http://scintilla.org/
[2] https://sourceforge.net/p/scintilla/bugs/1207/
[3] https://sourceforge.net/p/scintilla/bugs/1454/
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/879

-- Commit Summary --

  * c++: Fix parsing of C++11 raw string literals

-- File Changes --

    M tagmanager/ctags/c.c (2)
    M tagmanager/ctags/get.c (92)
    M tagmanager/ctags/get.h (3)
    M tests/ctags/Makefile.am (1)
    A tests/ctags/cxx11-raw-strings.cpp (21)
    A tests/ctags/cxx11-raw-strings.cpp.tags (11)

-- Patch Links --

https://github.com/geany/geany/pull/879.patch
https://github.com/geany/geany/pull/879.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/879
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160123/d31e3c9a/attachment.html>


More information about the Github-comments mailing list