Finding mismatched parens?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Finding mismatched parens?

跳至解决方案
764 次查看
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 项奖励
1 解答
687 次查看
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 项奖励
5 回复数
687 次查看
converse
Senior Contributor V
0 项奖励
687 次查看
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 项奖励
687 次查看
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 项奖励
688 次查看
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 项奖励
687 次查看
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 项奖励