mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fix an "IndexError: list index out of range" for Arduino sketch preprocessor // Resolve #2268
This commit is contained in:
@ -17,6 +17,8 @@ PlatformIO 3.0
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Project Generator: fixed a VSCode C/C++'s "Cannot find" warning when CPPPATH folder does not exist
|
||||
* Fixed an "IndexError: list index out of range" for Arduino sketch preprocessor
|
||||
(`issue #2268 <https://github.com/platformio/platformio-core/issues/2268>`_)
|
||||
|
||||
3.6.6 (2019-03-29)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -157,9 +157,7 @@ class InoToCPPConverter(object):
|
||||
return total
|
||||
|
||||
def append_prototypes(self, contents):
|
||||
prototypes = self._parse_prototypes(contents)
|
||||
if not prototypes:
|
||||
return contents
|
||||
prototypes = self._parse_prototypes(contents) or []
|
||||
|
||||
# skip already declared prototypes
|
||||
declared = set(
|
||||
@ -168,6 +166,9 @@ class InoToCPPConverter(object):
|
||||
m for m in prototypes if m.group(1).strip() not in declared
|
||||
]
|
||||
|
||||
if not prototypes:
|
||||
return contents
|
||||
|
||||
prototype_names = set(m.group(3).strip() for m in prototypes)
|
||||
split_pos = prototypes[0].start()
|
||||
match_ptrs = re.search(
|
||||
|
Reference in New Issue
Block a user