diff --git a/HISTORY.rst b/HISTORY.rst index 2fc14056..052b63b2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -74,6 +74,7 @@ PlatformIO 3.0 ``-v, --verbose`` option (`issue #721 `_) * Improved INO to CPP converter + (`issue #659 `_) * Added ``license`` field to `library.json `__ (`issue #522 `_) * Warn about unknown options in project configuration file ``platformio.ini`` diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 2dd9c013..33d9b2cb 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -31,7 +31,7 @@ from platformio import util class InoToCPPConverter(object): PROTOTYPE_RE = re.compile(r"""^( - (\s*[a-z_\d]+\*?){1,2} # return type + ([a-z_\d]+\*?){1,2} # return type (\s+[a-z_\d]+\s*) # name of prototype \([a-z_,\.\*\&\[\]\s\d]*\) # arguments )\s*\{ # must end with { diff --git a/tests/ino2cpp/basic/basic.ino b/tests/ino2cpp/basic/basic.ino index c44340aa..80b3be86 100644 --- a/tests/ino2cpp/basic/basic.ino +++ b/tests/ino2cpp/basic/basic.ino @@ -9,9 +9,13 @@ struct Item { class Foo { public: - Foo(void (*function)()) { - #warning "Line number is 13" - } + Foo(void (*function)()) { + #warning "Line number is 13" + } + + bool childFunc() { + + } }; diff --git a/tests/test_ino2cpp.py b/tests/test_ino2cpp.py index c414ebc6..0bb6b143 100644 --- a/tests/test_ino2cpp.py +++ b/tests/test_ino2cpp.py @@ -40,5 +40,5 @@ def test_warning_line(clirunner, validate_cliresult): result = clirunner.invoke(cmd_ci, [join(INOTEST_DIR, "basic"), "-b", "uno"]) validate_cliresult(result) - assert ('basic.ino:13:4: warning: #warning "Line number is 13"' in + assert ('basic.ino:13:14: warning: #warning "Line number is 13"' in result.output)