/
(?x)^
(?<StatementDesc>(?:
(?:
[\/\/].+(?=\n)\n)*
)*
)
(?:
(?:
# Begin Function Declaration
func[[:space:]]+
# Datatype Method?
(?:
\(
(?<funcRecvrVar>[a-zA-Z_]+)
[[:space:]]+
(?<funcRecvrTypePointerChar>\*?)
(?<funcRecvrType>[^[[:space:]\)]+)
(?<funcRecvrErr>.*?(?=[\)]))
\)
)?
[[:space:]]*
# Function Name
(?<funcName>[a-zA-Z]+)
[[:space:]]*
# Parameters
\((?<funcParamBody>
# <funcParam> is optional
(?<funcParam>
(?<funcParam1>
(?<funcParam1Name>
[A-Za-z_\d]+
(?:
[[:space:]]+
(?<funcParam1Type>
[A-Za-z_\d]+
[[:space:]]*
)?
|
[[:space:]]*
)?
)
)
# Next Parameter recursion
(?:
# Check if comma
(?=,)[,]
[[:space:]]*
(?<funcParam2>
(?<funcParam2Name>
[A-Za-z_\d]+
(?:
[[:space:]]+
(?<funcParam2Type>
[A-Za-z_\d]+
[[:space:]]*
)?
|
[[:space:]]*
)?
)
)
# Next Parameter recursion
(?:
# Check if comma
(?=,)[,]
[[:space:]]*
(?<funcParam3>
(?<funcParam3Name>
[A-Za-z_\d]+
(?:
[[:space:]]+
(?<funcParam3Type>
[A-Za-z_\d]+
[[:space:]]*
)?
|
[[:space:]]*
)?
)
)
)?
)?
(?<funcParamRest>[^\)]*)
)?
)\)
[[:space:]]*
# Return Value
(?:
# Return inside parens
(?:[\(]
(?<funcReturn1>[^\),[:space:]]+)
(?:
[[:space:]]*[,][[:space:]]*
(?<funcReturn2>[^\),[:space:]]+)
(?:
[[:space:]]*[,][[:space:]]*
(?<funcReturn3>[^\),[:space:]]+)
)?
)?
[\)]
)
|
# Single Return Outside Parens
(?<funcReturnSingle>[^\{[:space:]]+)
|
)?
[[:space:]]*
[[:space:]]*
)
# Remove Non-relevant lines
(?<removed>
(?:
# At new line, check if its blank || begins with spaces or not `func`
(?=
(?:
$