Closed s4my closed 1 year ago
I was thinking about adding an enum inside of the UIDrawStringHighlighted()
function to define the lex states, and replace all the random numbers the lexState
is equated to with meaningful states making the code more readable:
enum lexStates {
DEFAULT,
COMMENT,
STRING,
NUMBER,
OPERATOR,
PREPROCESSOR,
};
Then for e.g., replace lexState = 5
with lexState = PREPROCESSOR
. what do you think ?
Of course if you have any nitpicks for the names or the syntax please do tell.
I also would suggest to rename lexState
to tokenType
thus lexStates
to tokenTypes
.
I was thinking about adding an enum inside of the
UIDrawStringHighlighted()
function to define the lex states, and replace all the random numbers thelexState
is equated to with meaningful states making the code more readable:enum lexStates { DEFAULT, COMMENT, STRING, NUMBER, OPERATOR, PREPROCESSOR, };
Then for e.g., replace
lexState = 5
withlexState = PREPROCESSOR
. what do you think ? Of course if you have any nitpicks for the names or the syntax please do tell.
You could do,
typedef enum _UICodeTokenType {
UI_CODE_TOKEN_TYPE_DEFAULT,
// ...
} _UICodeTokenType;
This PR is a fix for the issue #88.