Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 149-156
Link Here
|
149 |
IBuffer buffer= source.getBuffer(); |
149 |
IBuffer buffer= source.getBuffer(); |
150 |
if (buffer != null) { |
150 |
if (buffer != null) { |
151 |
IScanner scanner= ToolFactory.createScanner(false, false, false, false); |
151 |
IScanner scanner= ToolFactory.createScanner(false, false, false, false); |
152 |
scanner.setSource(buffer.getText(start, length).toCharArray()); |
|
|
153 |
try { |
152 |
try { |
|
|
153 |
scanner.setSource(buffer.getText(start, length).toCharArray()); |
154 |
int token= scanner.getNextToken(); |
154 |
int token= scanner.getNextToken(); |
155 |
if (token != ITerminalSymbols.TokenNameEOF) { |
155 |
if (token != ITerminalSymbols.TokenNameEOF) { |
156 |
int tStart= scanner.getCurrentTokenStartPosition(); |
156 |
int tStart= scanner.getCurrentTokenStartPosition(); |
Lines 163-168
Link Here
|
163 |
} |
163 |
} |
164 |
} catch (InvalidInputException e) { |
164 |
} catch (InvalidInputException e) { |
165 |
// ignore |
165 |
// ignore |
|
|
166 |
} catch (IndexOutOfBoundsException e) { |
167 |
return null; |
166 |
} |
168 |
} |
167 |
} |
169 |
} |
168 |
} |
170 |
} |