|
Bugzilla – Full Text Bug Listing |
| Summary: | Incorrect highlighting for context-sensitive keywords (from, where, get, select...) | ||
|---|---|---|---|
| Product: | [Mono] MonoDevelop | Reporter: | Marek Safar <msafar> |
| Component: | texteditor | Assignee: | Mike Krueger <mkrueger> |
| Status: | RESOLVED FIXED | QA Contact: | MD Bugs <monodevelop-bugs> |
| Severity: | Enhancement | ||
| Priority: | P5 - None | CC: | andreventuravale |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
Thats true for all context sensitive keywords.
Try:
class get
{
}
in gedit - it's the same. It's not possible to define a context sensitive keyword sheme with a context free grammar.
We can fix this, when we're highlighting the parse tree and not the chars. This may *not* be soon.
So long I recommend not using context keywords as class name.
Heh, that's easier said than done. Especially when the code is not yours and there is ~16 context keywords. It's clearly a bug. no it's mimic gedit behavior :) (I suppose vi/emacs have the same problem with context sensitive keywords. Either you don't highlight them or you've something like this) Actually, I believe that GtkSourceView could handle this, since its highlighter has the concept of a context. So they could, for instance, match on "class (.*) {" and "}" to create a context in which these are keywords.
http://library.gnome.org/devel/gtksourceview-2.0/stable/lang-reference.html
There are two levels of difference in chomsky hierarchy, it's even not possible to define a context free grammar in the source editors.
class Test
{
void TestMethod()
{
int where;
}
}
btw. "where" is not the only one, there are many more (around 16 may be right, I've not counted them). Trying to solve this with regular expressions is pointless. *** Bug 537801 has been marked as a duplicate of this bug. *** *** Bug 540298 has been marked as a duplicate of this bug. *** Changing summary to make the bug more searchable (to avoid dupes). implemented. |
"where" is context sensitive keyword, in following code is only 1 where which is keyword color class where { } delegate void D<T> () where T : where;