Skip to content

Conversation

Chris--A
Copy link
Contributor

This is a fix for #956

Comments are still stripped, however, single line comments with a multi line directive are replaced with spaces while preserving the comment and multi line slash.


//A standard comment
unsigned char values[] = {
45, 12, 56, // A comment with a multi line pre-processor \
45, 13, 57,
45, 13, 58
};

/***
 * 
 * A fancy comment
 * 
 */

void setup() {/* An inline comment */}
void loop() {}

After pre-processing:

#line 1 "comment_error.ino"


#include "Arduino.h"
void setup();
void loop();
#line 3
unsigned char values[] = {
45, 12, 56,                                            //\
45, 13, 57,
45, 13, 58
};







void setup() {                       }
void loop() {}

@ffissore
Copy link
Contributor

PdePreprocessor is a pit I don't want to dig further. #2729 fixes many of its issues but it's also outdated. I'll work on it next week. Thank you all the same

@ffissore ffissore closed this May 28, 2015
@ffissore ffissore added the Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation label May 28, 2015
@ffissore ffissore added this to the Release 1.6.5 milestone May 28, 2015
@ffissore ffissore self-assigned this May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Preprocessor The Arduino sketch preprocessor converts .ino files into C++ code before compilation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants