dj0tt / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Auto-format reports "too many right parentheses" when a long comment is used #974

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Add a long comment to a working sketch, such as:

2. Example: //if (tempVar == 0){ //reset the midi clock so as soon as non-zero 
events come we have not wasted time (Sympton: First notes go too quick)

3. Attempt an auto-format

What is the expected output? What do you see instead?

I expect auto-format to work.

Instead I see: Auto Format Cancelled: Too many right parentheses

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

IDE 1.0.1
OS/X
Board not relevant

Please provide any additional information below.

Example sketch that reproduces this behaviour:

// ----------------------------------
void setup ()
{
}

//if (tempVar == 0){ //reset the midi clock so as soon as non-zero events come 
we have not wasted time (Sympton: First notes go too quick)

void loop () {
}
// ----------------------------------

Note that if the comment is made slightly smaller (eg. delete "midi clock") 
then the auto-format works correctly.

Original issue reported on code.google.com by n...@gammon.com.au on 3 Jul 2012 at 9:19

GoogleCodeExporter commented 9 years ago
This seems to be fixed in the latest version in GitHub, I think because of this 
commit: 
https://github.com/arduino/Arduino/commit/6030f9670b11389a054470a38f39ffcf8c2c6d
85

Original comment by dmel...@gmail.com on 15 Jul 2012 at 1:53

GoogleCodeExporter commented 9 years ago
The old 133 character comment-limit-trick huh? Well does the fix also fix this 
...

This sketch:

// ----------------------------------
void setup ()
{
}

//if (tempVar == 0){ //reset the cxlock so as soon as non-zero events come we 
have not wasted time (Sympton: First notes go too quick)

void loop () {
}
// ----------------------------------

The comment line is 136 characters. If I auto-format that in the IDE (1.0.1) I 
get no error message. However the trailing parenthesis disappears from the 
comment line.

So it is a destructive change, but without an error message, you might not 
notice it.

I can open a new bug report if you prefer.

Original comment by n...@gammon.com.au on 15 Jul 2012 at 2:31

GoogleCodeExporter commented 9 years ago
That problem seems to be fixed too.

Original comment by dmel...@gmail.com on 15 Jul 2012 at 2:36