Bug 270319 - "new" parsed as keyword in C sources although it is not even reserved
Summary: "new" parsed as keyword in C sources although it is not even reserved
Status: RESOLVED DUPLICATE of bug 57156
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: 4.0.0
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 13:51 UTC by Michal Srb
Modified: 2013-03-31 00:47 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Srb 2011-04-07 13:51:33 UTC
Version:           4.0.0
OS:                Linux

Hi, I love to use kdevelop to examine source code of open source projects. They are mostly written in C.
They are sometimes using variables called "new". It is legal in C as "new" is not keyword or reserved word (AFAIK), but it confuses kdevelop's parser and so the navigation and code completion is not so useful in them.

I would never use a variable called "new" in my project, however it is quite often used in already existing ones. Is it possible to parse "new" as normal name when in C source?

Reproducible: Always

Steps to Reproduce:
Use variable called "new" in C source.



It can be partly workarounded by adding this line on the top of source:
#define new new_
Comment 1 Milian Wolff 2011-04-08 13:47:43 UTC
there is no support for plain C yet

*** This bug has been marked as a duplicate of bug 57156 ***
Comment 2 Aleix Pol 2011-04-13 17:44:00 UTC
That bug is related to the Kate highlighting, it's not about C being supported, I think it should be re-assigned to Kate.
Comment 3 Michal Srb 2011-04-13 17:53:58 UTC
(In reply to comment #2)
> That bug is related to the Kate highlighting, it's not about C being supported,
> I think it should be re-assigned to Kate.

No, the basic C highlighting is working correctly (the "new" word is not bold). I was just complaining about the kdevelop parser.

I didn't know that plain C is not supported.
Comment 4 Aleix Pol 2011-04-13 18:42:35 UTC
Ok, sorry. I withdraw my comment then :).
Comment 5 Aleix Pol 2013-03-31 00:47:06 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively