Skip to content

Commit

Permalink
improve regex
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Nov 13, 2024
1 parent 6b61ba2 commit 67b8ded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generate_api_from_protos.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down

0 comments on commit 67b8ded

Please sign in to comment.