is_function_signature

Function is_function_signature 

Source
pub(crate) fn is_function_signature(decls: &str) -> bool
Expand description

Detect “this decls capture is actually a function signature”. decls is the text the local-decl regex captured between the type and the terminating ;. A function signature shape is <ident>(...) { ... return ... with the ; being the first statement-terminator inside the body, but the giveaway sits at the front: a ( appears before any =. Variable declarations never put ( ahead of the initializer assignment (var x = sin(0);( follows =).