forked from platformio/platformio-core
Fix error with conflicting declaration of a prototype (Arduino sketch preprocessor)
This commit is contained in:
@@ -7,6 +7,7 @@ PlatformIO 3.0
|
|||||||
3.6.6 (2019-??-??)
|
3.6.6 (2019-??-??)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Fixed error with conflicting declaration of a prototype (Arduino sketch preprocessor)
|
||||||
* Fixed "FileExistsError" when `platformio ci <https://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__ command is used in pair with ``--keep-build-dir`` option
|
* Fixed "FileExistsError" when `platformio ci <https://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__ command is used in pair with ``--keep-build-dir`` option
|
||||||
|
|
||||||
3.6.5 (2019-03-07)
|
3.6.5 (2019-03-07)
|
||||||
|
@@ -36,7 +36,7 @@ class InoToCPPConverter(object):
|
|||||||
([a-z_\d\&]+\*?\s+){1,2} # return type
|
([a-z_\d\&]+\*?\s+){1,2} # return type
|
||||||
([a-z_\d]+\s*) # name of prototype
|
([a-z_\d]+\s*) # name of prototype
|
||||||
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
||||||
)\s*\{ # must end with {
|
)\s*(\{|;) # must end with `{` or `;`
|
||||||
""", re.X | re.M | re.I)
|
""", re.X | re.M | re.I)
|
||||||
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
||||||
PROTOPTRS_TPLRE = r"\([^&\(]*&(%s)[^\)]*\)"
|
PROTOPTRS_TPLRE = r"\([^&\(]*&(%s)[^\)]*\)"
|
||||||
@@ -162,7 +162,14 @@ class InoToCPPConverter(object):
|
|||||||
if not prototypes:
|
if not prototypes:
|
||||||
return contents
|
return contents
|
||||||
|
|
||||||
prototype_names = set([m.group(3).strip() for m in prototypes])
|
# skip already declared prototypes
|
||||||
|
declared = set(
|
||||||
|
m.group(1).strip() for m in prototypes if m.group(4) == ";")
|
||||||
|
prototypes = [
|
||||||
|
m for m in prototypes if m.group(1).strip() not in declared
|
||||||
|
]
|
||||||
|
|
||||||
|
prototype_names = set(m.group(3).strip() for m in prototypes)
|
||||||
split_pos = prototypes[0].start()
|
split_pos = prototypes[0].start()
|
||||||
match_ptrs = re.search(
|
match_ptrs = re.search(
|
||||||
self.PROTOPTRS_TPLRE % ("|".join(prototype_names)),
|
self.PROTOPTRS_TPLRE % ("|".join(prototype_names)),
|
||||||
|
@@ -49,4 +49,12 @@ void fooCallback(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
void some_extern(const char *fmt, ...);
|
||||||
|
};
|
||||||
|
|
||||||
|
void some_extern(const char *fmt, ...) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// юнікод
|
// юнікод
|
||||||
|
Reference in New Issue
Block a user