summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2021-09-30 13:15:17 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-01 09:09:43 +0000
commit6b596bee068ca6f33bb8d11e0a5c2d3a4604871c (patch)
tree0a649ca2e6865604ab9d925ffbfab67822b8413c
parentdbc1558c27189684bc32f9d1bc09ab8f309e4908 (diff)
downloadqttools-6b596bee068ca6f33bb8d11e0a5c2d3a4604871c.tar.gz
QDoc: Double the buffer size for Tokenizer
`Tokenizer` uses a fixed-size buffer when parsing the sources. When the buffer is filled, the parsing continues but all characters from the currently parsed token that do not fit into the buffer are discarded. The limit was recently surpassed by some of the auto-generated QDoc comment-blocks from the Squish documentation. While the incriminated comment-blocks will be reduced in size in the future, it was decided to increase the buffer size to allow for some more breathing space. Hence, the size of the buffer was doubled, to about 1Mb. Change-Id: I0962e367470e57386bc0e15f58be979e4a1a3692 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 6e74f7b506935f18a33cd5918a1c6c4f4c9cddc4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qdoc/tokenizer.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qdoc/tokenizer.h b/src/qdoc/tokenizer.h
index 77b6bb193..a7b1728fb 100644
--- a/src/qdoc/tokenizer.h
+++ b/src/qdoc/tokenizer.h
@@ -127,13 +127,14 @@ private:
void init();
void start(const Location &loc);
/*
- Represents the maximum amount of characters that can appear in a
- block-comment.
+ Represents the maximum amount of characters that a token can be composed
+ of.
- When a block-comment with more characters than the maximum amount is
- encountered, a warning is issued.
+ When a token with more characters than the maximum amount is encountered, a
+ warning is issued and parsing continues, discarding all characters from the
+ currently parsed token that don't fit into the buffer.
*/
- enum { yyLexBufSize = 524288 };
+ enum { yyLexBufSize = 1048576 };
int getch() { return m_pos == m_in.size() ? EOF : m_in[m_pos++]; }