View previous topic :: View next topic |
Author |
Message |
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
PCW IDE brace-matching bug? |
Posted: Thu May 13, 2004 1:01 pm |
|
|
I can't believe I'm the only one having this problem, but I can't find any other posts about it. My braces aren't matching correctly 50% of the time, though the code compiles fine (no missing braces). Often I'll press CTRL+] while the cursor is to either side of a paren or brace, and nothing happens. If I find the closing brace myself, then press CTRL+], the IDE jumps to the opening brace fine, but won't jump back.
Now, in situations where I can jump to a closing brace, I've also noticed that on closing brace lines that have comments afterwards, the IDE will overshoot the closing brace by a few spaces if tabs are used to indent the closing brace. If spaces are used, it works fine.
This is a brand new installation of PCW, IDE version 3.43, and this is my first time using PCW. I'm running it on a Win98 SE machine. Is this a known issue? |
|
|
Kenny
Joined: 07 Sep 2003 Posts: 173 Location: Australia
|
|
Posted: Thu May 13, 2004 5:19 pm |
|
|
I also use IDE version 3.43 under Win98SE. You also need to state the PCM version (it's under Help - About).
With PCM version 3.188 it works fine. Also, if you click on a brace, it and the corresponding brace should highlight in green for a moment.
A few PCM versions ago there was a problem with the braces - if a closing brace was left off, the compiler sometimes would not throw up an error.
Took a while to realise what was happening! |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu May 13, 2004 8:11 pm |
|
|
Look at this:
Code: |
1: #if DEFINED_CONST
2: while (!done) {
3: #else
4: while ((!done)&&(otherstuff)) {
5: #endif
6: //code//
7: }
|
The IDE isn't smart enough to know that this is conditionaly compiled. If you goto line 4 and goto the end bracket it will goto line 7. If you goto line 2 and goto the end bracket it will go to the next closing bracket even though it doesn't match.
This is the only 'bug' with bracket match feature that I know. |
|
|
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
Example Code |
Posted: Fri May 14, 2004 7:43 am |
|
|
The following code fragment illustrates the behavior in PCM 3.189.
* I cannot match to the closing brace on main(), but I can match to its opening brace.
* Likewise with the first do {} block
* Matching to the closing brace of the if{} block overshoots the closing brace by a couple of spaces.
Removing the puts() line fixes the problem.
--
Jeff S.
Code: | void main (void)
{
do {
do {
} while ((temp_str[0] != 'A') && (attempts < 20));
if (temp_str[0] != 'A') {
} else {
};
puts ("AT+CMGS=\"xxxxxxxxxx\"", PHONE);
} while (TRUE);
} |
|
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Fri May 14, 2004 8:06 am |
|
|
The IDE is confused by the \". |
|
|
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
|
Posted: Fri May 14, 2004 9:01 am |
|
|
Darren Rook wrote: | The IDE is confused by the \". |
Well since nobody has indicated that this is a known issue, I guess I'll submit a bug report.
--
Jeff S. |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Fri May 14, 2004 10:27 am |
|
|
object01 wrote: | Darren Rook wrote: | The IDE is confused by the \". |
Well since nobody has indicated that this is a known issue, I guess I'll submit a bug report.
--
Jeff S. |
I a bit confused myself. What is that line suposed to do? |
|
|
object01
Joined: 13 May 2004 Posts: 90 Location: Nashville, TN
|
|
Posted: Fri May 14, 2004 11:49 am |
|
|
Neutone wrote: | I a bit confused myself. What is that line suposed to do? |
The issue is that the IDE fails to match braces correctly in some circumstances, paricularly if an escaped " is included in a string. The code included toward the beginning of the thread illustrates the problem. |
|
|
|