blob: 4e76936b33886fa653cb11a7f4a17312dd3750c8 (plain
author Christian Tismer <firstname.lastname@example.org> 1442304551 +0200
committer Christian Tismer <email@example.com> 1442305044 +0200
Qt5.5: change parser and lexer to support the new Q_ENUM (not Q_ENUMS) macro.
This was a bit hard to understand, because of the structure of the lexer:
The tokens to be recognized by the lexer are directly coded into C.
There is no notation of the length of a token in the lexer:
The tokens are first scanned to find their length. Then, lexer functions indexed
by length are called to identify the tokens.
After I understood that (with way too long debugging), it was simple to add a new token.
All the functions Lexer::scanKeyword0() to Lexer::scanKeyword16() should not have
been written by hand, but generated by a simple Python script that writes the explicit C code.