Support top-level comments in SplitSource.php.

This commit is contained in:
levlam 2021-02-12 17:27:07 +03:00
parent 22289fe68b
commit 155d83c58f
2 changed files with 13 additions and 3 deletions

View File

@ -75,6 +75,7 @@ function split_file($file, $chunks, $undo) {
$target_depth = 1 + $is_generated;
$is_static = false;
$in_define = false;
$in_comment = false;
$current = '';
$common = '';
$functions = array();
@ -113,6 +114,17 @@ function split_file($file, $chunks, $undo) {
continue;
}
if ($in_comment && strpos($line, '*/') === 0) {
$in_comment = false;
continue;
}
if (strpos($line, '/*') === 0) {
$in_comment = true;
}
if ($in_comment) {
continue;
}
if ($depth !== $target_depth) {
$common .= $line;
continue;
@ -285,7 +297,7 @@ function split_file($file, $chunks, $undo) {
'[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb',
'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory',
'top_dialog_manager[_(-][^.]|TopDialogManager' => 'TopDialogManager',
'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]' => 'UpdatesManager',
'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager',
'WebPageId(Hash)?' => 'WebPageId',
'web_pages_manager[_(-][^.]|WebPagesManager' => 'WebPagesManager');

View File

@ -522,8 +522,6 @@ class SaveAppLogQuery : public Td::ResultHandler {
}
};
/*** Td ***/
/** Td queries **/
class TestQuery : public Td::ResultHandler {
public:
explicit TestQuery(uint64 request_id) : request_id_(request_id) {