This repository was archived by the owner on Apr 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,13 @@ function(arduino_cmake_project _project_name)
1111
1212 setup_project_core_lib(${_project_name} )
1313
14+ set (ARDUINO_CMAKE_FUNCTION_DEFINITION_REGEX_PATTERN
15+ "^([A-Za-z0-9_][ \t\r\n ]*)+\\ (.*\\ )$" PARENT_SCOPE)
16+ set (ARDUINO_CMAKE_FUNCTION_DECLARATION_REGEX_PATTERN
17+ "^([A-Za-z0-9_])+.+([A-Za-z0-9_])+[ \t\r\n ]*\\ ((.*)\\ );$" PARENT_SCOPE)
18+ set (ARDUINO_CMAKE_FUNCTION_NAME_REGEX_PATTERN "(([A-Za-z0-9_])+)[ \t\r\n ]*\\ (.*\\ )" PARENT_SCOPE)
19+ set (ARDUINO_CMAKE_FUNCTION_ARGS_REGEX_PATTERN "\\ ((.*)\\ )" PARENT_SCOPE)
20+ set (ARDUINO_CMAKE_FUNCTION_SINGLE_ARG_REGEX_PATTERN "([A-Za-z0-9_]+)[^,]*" PARENT_SCOPE)
21+ set (ARDUINO_CMAKE_FUNCTION_ARG_TYPE_REGEX_PATTERN "[A-Za-z0-9_]+.*[ \t\r\n ]+" PARENT_SCOPE)
22+
1423endfunction ()
Original file line number Diff line number Diff line change @@ -19,8 +19,27 @@ function(set_internal_search_patterns)
1919 set (ARDUINO_CMAKE_NAME_WE_REGEX_PATTERN "([^\\ /]+)\\ ." CACHE STRING
2020 "Regex pattern matching name without file extension" )
2121
22- set (ARDUINO_CMAKE_FUNCTION_REGEX_PATTERN "^([a-z]|[A-Z])+.*\( ([a-z]|[A-Z])*\) " CACHE STRING
23- "Regex pattern matching a function signature in a source file" )
22+ #[[set(ARDUINO_CMAKE_FUNCTION_DECLARATION_REGEX_PATTERN "^([A-Za-z0-9_])+.+([A-Za-z0-9_])+[ \t\r\\n]*\((.*)\);$"
23+ CACHE STRING "Regex pattern matching a function signature definition in a source file")
24+
25+ set(ARDUINO_CMAKE_FUNCTION_DEFINITION_REGEX_PATTERN "^([A-Za-z0-9_])+[ \t\r\n]*\(([A-Za-z0-9_])*\)$"
26+ CACHE STRING "Regex pattern matching a function signature definition in a source file")
27+
28+ set(ARDUINO_CMAKE_FUNCTION_NAME_REGEX_PATTERN "(([A-Za-z0-9_])+)[ \t\r\\n]*\(.*\)"
29+ CACHE STRING
30+ "Regex pattern matching a function's name (and everything following it), can be retrieved by the 1st group")
31+
32+ set(ARDUINO_CMAKE_FUNCTION_ARGS_REGEX_PATTERN "\((.*)\)"
33+ CACHE STRING
34+ "Regex pattern matching a function's argument list, i.e. What's inside the parentheses")
35+
36+ set(ARDUINO_CMAKE_FUNCTION_SINGLE_ARG_REGEX_PATTERN "([A-Za-z0-9_]+)[^,]*"
37+ CACHE STRING
38+ "Regex pattern matching a function's argument, requiring maximum matches to get all arguments")
39+
40+ set(ARDUINO_CMAKE_FUNCTION_ARG_TYPE_REGEX_PATTERN "[A-Za-z0-9_]+.*[ \t\r\\n]+"
41+ CACHE STRING
42+ "Regex pattern matching a function argument type, ommiting it's name")]]
2443
2544endfunction ()
2645
You can’t perform that action at this time.
0 commit comments