Given the following from src/plugins/codecompletion/parser/tokenizer.h
enum TokenizerState
{
tsSkipEqual = 0x0001, /// Skip the assignment statement
tsSkipQuestion = 0x0002, /// Skip the conditional evaluation statement
tsSkipSubScrip = 0x0004, /// Skip the array-subscript notation statement
tsSingleAngleBrace = 0x0008, /// Reserve angle braces
tsReadRawExpression = 0x0010, /// Reserve every chars
tsSkipNone = 0x1000, /// Skip None
// convenient masks
tsSkipUnWanted = tsSkipEqual | tsSkipQuestion | tsSkipSubScrip,
tsTemplateArgument = tsSkipUnWanted | tsSingleAngleBrace
};
The tool tip for tsSkipQuestion is currently:
TokenizerState::tsSkipQuestion=
With this patch, it becomes:
TokenizerState::tsSkipQuestion=0x0002
With this patch, the tool tip for tsTemplateArgument is:
TokenizerState::tsTemplateArgument=tsSkipUnWanted|tsSingleAngleBrace
Given the following code:
enum HexAssignment
{
haFirst = 0x0001,
haSecond,
haThird
};
enum Colors
{
clRed,
clBlue,
clGreen
};
enum TestEnum
{
teFirst,
teSecond = 5,
teThird
};
haFirst is:
HexAssignment::haFirst=0x0001
haSecond is:
HexAssignment::haSecond=0x0002
haThird is:
HexAssignment::haThird=0x0003
clRed is:
clGreen is:
teFirst is
teThird is
enum TokenizerState
{
tsSkipEqual = 0x0001, /// Skip the assignment statement
tsSkipQuestion = 0x0002, /// Skip the conditional evaluation statement
tsSkipSubScrip = 0x0004, /// Skip the array-subscript notation statement
tsSingleAngleBrace = 0x0008, /// Reserve angle braces
tsReadRawExpression = 0x0010, /// Reserve every chars
tsSkipNone = 0x1000, /// Skip None
// convenient masks
tsSkipUnWanted = tsSkipEqual | tsSkipQuestion | tsSkipSubScrip,
tsTemplateArgument = tsSkipUnWanted | tsSingleAngleBrace,
tsAnotherState
};
What does not work is that with this patch tsAnotherState will still have the tool tip:
TokenizerState::tsAnotherState=
Just applied your patch (not test yet), and I see that the major part of your patch is handling the assignment.
Looks really nice.
So some suggestions:
// assignments (=xxx) are ignored by the tokenizer,
// so we don't have to worry about them here ;)
These two comment lines should be removed.
Maybe, add comments like:
enumerator->m_Args += peek; //emulator values were stored in m_Args field of the Token
// emulator value string may have two types, hex value with prefix "0x" or decimal value
if (lastEnumerator->m_Args.StartsWith(wxT("0x")))