Finding mismatched parens?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Finding mismatched parens?

Jump to solution
690 Views
GaryOlmstead
Senior Contributor I

I am using MCUXpresso 11.1 with a Kinetis K60.  I have a program that has one file of 2300 lines generated by another programmer, and several folders full of files generated by MCUXpresso.  The compiler quits with "syntax error: unexpected "(" ".  There is no context that helps to narrow down the location of the problem.  I assume it's in the 2300 line file, but I can't prove it.  I tried looking for the question mark in the left margin, but didn't see anything.

I've searched the user guide, but couldn't find anything helpful.

Is there a way to search for unmatched brackets/braces/arrows/etc?

0 Kudos
1 Solution
613 Views
GaryOlmstead
Senior Contributor I

HI Con --

Well, the problem went away more or less by itself.  I created a new file, copied and pasted the entire old file, and it compiles with no complaints. 

I opened the old file with a text editor that allows the user to display any file as hexadecimal.  I looked at the start and end of the file for any characters that didn't belong.  There were none.  The file is too big to look at very much.

Along the way, the person who wrote the first file sent an update that had exactly the same problem, so there could still be something out there.

Anyway, it's gone now, so on to the next issue.

Thanks for your help.


Gary

View solution in original post

0 Kudos
5 Replies
613 Views
converse
Senior Contributor V
0 Kudos
613 Views
GaryOlmstead
Senior Contributor I

Thanks for the suggestion, but I get a popup that says it isn't compatible with my version of Eclipse.  I know there's a new version of Eclipse (2020-03).  I'm not sure which version I have, the Help >> Installation Details log doesn't mention Eclipse at all.  Checking for updates says I am up to date, but I haven't believed that for awhile.

0 Kudos
613 Views
converse
Senior Contributor V

Looking at the Bracketeer comments, it looks like it has not been updated to run with the latest version of Eclipse - the last version is 2018-06 and MCUXpresso is 2019-06 (which is the latest).

There is simple bracket matching built-in to the editor. Use Ctrl-Shift-P (Cmd-Shift-P on a Mac). This key combination can be changed with the setting in Preferences->General->Keys and search for Go to Matching Bracket.

0 Kudos
614 Views
GaryOlmstead
Senior Contributor I

HI Con --

Well, the problem went away more or less by itself.  I created a new file, copied and pasted the entire old file, and it compiles with no complaints. 

I opened the old file with a text editor that allows the user to display any file as hexadecimal.  I looked at the start and end of the file for any characters that didn't belong.  There were none.  The file is too big to look at very much.

Along the way, the person who wrote the first file sent an update that had exactly the same problem, so there could still be something out there.

Anyway, it's gone now, so on to the next issue.

Thanks for your help.


Gary

0 Kudos
613 Views
converse
Senior Contributor V

You might want to compare the two files. If they are both present in the same IDE, you can select both files (select the 1st and then Ctrl-Click on the 2nd). Then right-click and Compare->With each other. This will show the two files side-by-side, highlighting any difference.

Anyway, glad you solved your problem

0 Kudos