Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

convert "." to "->"

(1/6) > >>

blueshake:
hello,
This patch can convert "." to "->" when the token is pointer.NOT smart but work. :)
any idea/comment is welcome.

MortenMacFly:

--- Quote from: blueshake on October 27, 2009, 12:32:11 pm ---This patch can convert "." to "->" when the token is pointer.NOT smart but work. :)
any idea/comment is welcome.

--- End quote ---
What would happen if I *really* would like to enter a dot? E.g. the parser has parsed incorrectly? Would it always be replaced with the pointer operator then? If yes, then this should surely be configurable.

oBFusCATed:
100% make it configurable, so I can disable it  :lol:

blueshake:

--- Quote ---What would happen if I *really* would like to enter a dot? E.g. the parser has parsed incorrectly? Would it always be replaced with the pointer operator then? If yes, then this should surely be configurable.
--- End quote ---
The following patch can do this.for the second time ,it would not work.(just delete the "->" ,press "." again.)

1.can anyboby make this function be confgurable,I don't know how to do this. :)
2.not work for abc().:,because now I just simplely skip the "."

--- Code: ---struct qq
{
    int x;
    int y;
};
qq* abc(int aa)
{

}
int main()
{
    qq* pp;
    pp->
    cout << "Hello world!" << endl;
    return 0;
}
--- End code ---



Edit:

need helps to refine this function. :)

killerbot:
sounds nice. From asking around a bit, it seems it should be configurable (some people will turn it of).
The best thing for the moment is to try it out (once you have some more or less final patch), and see how many times the parser would pull our leg.

Some extra thoughts :
* would be nice if it is aware of stl iterators, and do the same trick
* in future this is going to be hell for our parsers,thanks to the auto variable (C++0x will rock, but for parsers/IDE's lofe won't get any easier ;-) )

Navigation

[0] Message Index

[#] Next page

Go to full version