Bug 50817 - Java parser doesn't handle comments properly
Summary: Java parser doesn't handle comments properly
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.2   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.0 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-28 20:34 EST by Nick Lothian CLA
Modified: 2004-01-29 04:12 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Lothian CLA 2004-01-28 20:34:26 EST
The code:

String input = "/3423432/dasd.xml";
/*		
Pattern p = Pattern.compile("/\\S*/");
Matcher m = p.matcher(input);
boolean found = m.find();
System.out.println("found = " + found);
System.out.println("Group is " + m.group());
*/

should be the equivalent of

String input = "/3423432/dasd.xml";

//	Pattern p = Pattern.compile("/\\S*/");
//	Matcher m = p.matcher(input);
//	boolean found = m.find();
//	System.out.println("found = " + found);
//	System.out.println("Group is " + m.group());

but the parser seems to get confused by the string "/\\S*/", and ends the block
comment there.

Workaround is to comment each line out
Comment 1 Philipe Mulet CLA 2004-01-29 04:12:32 EST
Read JLS 3.7 carefuly, and you'll see that we do the right thing.
You should rather argue against the spec.

Closing