aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2
blob: 4e76936b33886fa653cb11a7f4a17312dd3750c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
tree 0a00cd8f85a6d08e4f08938288e7264386c27e0b
parent 3744b4275f1402a7cf86015da54d7592c9fb6e09
author Christian Tismer <ctismer@gmail.com> 1442304551 +0200
committer Christian Tismer <ctismer@gmail.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.