mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Bug 324324 - The LR Parser test utility function getCompletionNode gets a wrong offset.
This commit is contained in:
parent
7b7c0e00fd
commit
3712f8e971
1 changed files with 5 additions and 1 deletions
|
@ -257,7 +257,11 @@ public class ParseHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IASTCompletionNode getCompletionNode(String code, ILanguage lang) {
|
public static IASTCompletionNode getCompletionNode(String code, ILanguage lang) {
|
||||||
return getCompletionNode(code, lang, code.length());
|
int offset = code.length();
|
||||||
|
if(offset > 0 && '\n' == code.charAt(offset-1)){
|
||||||
|
offset--;
|
||||||
|
}
|
||||||
|
return getCompletionNode(code, lang, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue