From cdd058565e981c3c94c3ddb2dea9b11d68f7a8f9 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 26 Apr 2019 16:33:39 +0300 Subject: [PATCH] Increase number of parts in SplitSource. GitOrigin-RevId: 1c9649938968b8ef6fd5b5c25ef30697338ab871 --- SplitSource.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SplitSource.php b/SplitSource.php index be389dde..bc7b2434 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -84,7 +84,9 @@ function split_file($file, $chunks, $undo) { $add_depth = strpos($line, 'namespace ') === 0 ? 1 : (strpos($line, '} // namespace') === 0 ? -1 : 0); if ($add_depth) { # namespace begin/end - $depth += $add_depth; + if ($add_depth > 0) { + $depth += $add_depth; + } if ($depth <= $target_depth) { if ($add_depth > 0) { $namespace_begin .= $line; @@ -92,6 +94,9 @@ function split_file($file, $chunks, $undo) { $namespace_end .= $line; } } + if ($add_depth < 0) { + $depth += $add_depth; + } if ($is_static) { $common .= $current; } else { @@ -210,10 +215,11 @@ if (in_array('--help', $argv) || in_array('-h', $argv)) { } $undo = in_array('--undo', $argv) || in_array('-u', $argv); -$files = array('td/telegram/ContactsManager' => 10, - 'td/telegram/MessagesManager' => 20, - 'td/telegram/Td' => 20, +$files = array('td/telegram/ContactsManager' => 20, + 'td/telegram/MessagesManager' => 50, + 'td/telegram/NotificationManager' => 10, 'td/telegram/StickersManager' => 10, + 'td/telegram/Td' => 40, 'td/generate/auto/td/telegram/td_api' => 10, 'td/generate/auto/td/telegram/td_api_json' => 10, 'td/generate/auto/td/telegram/telegram_api' => 10);