mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Added support for templated methods in InoToCPPConverter (#858)
* Added support for templated methods in InoToCPPConverter
This commit is contained in:
@ -32,6 +32,7 @@ from platformio import util
|
||||
class InoToCPPConverter(object):
|
||||
|
||||
PROTOTYPE_RE = re.compile(r"""^(
|
||||
(?:template\<.*\>\s*)? # template
|
||||
([a-z_\d]+\*?\s+){1,2} # return type
|
||||
([a-z_\d]+\s*) # name of prototype
|
||||
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
||||
|
@ -26,12 +26,15 @@ Foo foo(&fooCallback);
|
||||
|
||||
//
|
||||
|
||||
template<class T> T Add(T n1, T n2) {
|
||||
return n1 + n2;
|
||||
}
|
||||
|
||||
void setup() {
|
||||
struct Item item1;
|
||||
myFunction(&item1);
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
||||
@ -40,7 +43,7 @@ void myFunction(struct Item *item) {
|
||||
|
||||
}
|
||||
|
||||
#warning "Line number is 43"
|
||||
#warning "Line number is 46"
|
||||
|
||||
void fooCallback(){
|
||||
|
||||
|
@ -42,7 +42,7 @@ def test_warning_line(clirunner, validate_cliresult):
|
||||
validate_cliresult(result)
|
||||
assert ('basic.ino:16:14: warning: #warning "Line number is 16"' in
|
||||
result.output)
|
||||
assert ('basic.ino:43:2: warning: #warning "Line number is 43"' in
|
||||
assert ('basic.ino:46:2: warning: #warning "Line number is 46"' in
|
||||
result.output)
|
||||
result = clirunner.invoke(
|
||||
cmd_ci, [join(INOTEST_DIR, "strmultilines"), "-b", "uno"])
|
||||
|
Reference in New Issue
Block a user