From 67b8dedcab7bd416dd2193f7ef4dc6951f22db00 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 13 Nov 2024 11:47:21 +0200 Subject: [PATCH] improve regex --- generate_api_from_protos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_api_from_protos.php b/generate_api_from_protos.php index 57115c0..2ef20c6 100644 --- a/generate_api_from_protos.php +++ b/generate_api_from_protos.php @@ -178,7 +178,7 @@ function ParseTypeToRequestParameters( string $request, string $proto, int $leve $service = substr( $proto, $matches[ $i - 1 ][ 1 ][ 1 ], $matches[ $i ][ 1 ][ 1 ] - $matches[ $i - 1 ][ 1 ][ 1 ] ); - preg_match_all( "/rpc (.+?) \(.(.+?)\) returns \(.(?:.+?)\)\s*(?:;|\{\s*option \(method_description\) = \"(.+?)\";)$/m", $service, $rpcs ); + preg_match_all( "/rpc (.+?) \(\.?(.+?)\) returns \(\.?(?:.+?)\)\s*(?:;|{}|\{\s*option \(method_description\) = \"(.+?)\";)$/m", $service, $rpcs ); $generatedMethods = [];