1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Bug 324324 - The LR Parser test utility function getCompletionNode gets a wrong offset.

This commit is contained in:
Chris Recoskie 2010-09-02 18:45:34 +00:00
parent 7b7c0e00fd
commit 3712f8e971

View file

@ -257,7 +257,11 @@ public class ParseHelper {
}
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);
}