Improve INO to CPP converter // Resolve #659

This commit is contained in:
Ivan Kravets
2016-08-31 01:47:57 +03:00
parent e703054716
commit 7a88778f5e
4 changed files with 10 additions and 5 deletions

View File

@ -74,6 +74,7 @@ PlatformIO 3.0
``-v, --verbose`` option
(`issue #721 <https://github.com/platformio/platformio/issues/721>`_)
* Improved INO to CPP converter
(`issue #659 <https://github.com/platformio/platformio/issues/659>`_)
* Added ``license`` field to `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
(`issue #522 <https://github.com/platformio/platformio/issues/522>`_)
* Warn about unknown options in project configuration file ``platformio.ini``

View File

@ -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 {

View File

@ -13,6 +13,10 @@ class Foo {
#warning "Line number is 13"
}
bool childFunc() {
}
};
Foo foo(&fooCallback);

View File

@ -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)