Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2010-09-02 14:45:34 -0400
committerChris Recoskie2010-09-02 14:45:34 -0400
commit3712f8e97169559efb65a1b5f17e3fd0380d1c31 (patch)
tree08a4d6be95ec1d8043a58044deaa71027db6aa8e /lrparser
parent7b7c0e00fd344ffabaea7f6ff064df6466247336 (diff)
downloadorg.eclipse.cdt-3712f8e97169559efb65a1b5f17e3fd0380d1c31.tar.gz
org.eclipse.cdt-3712f8e97169559efb65a1b5f17e3fd0380d1c31.tar.xz
org.eclipse.cdt-3712f8e97169559efb65a1b5f17e3fd0380d1c31.zip
Bug 324324 - The LR Parser test utility function getCompletionNode gets a wrong offset.
Diffstat (limited to 'lrparser')
-rw-r--r--lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java b/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java
index d21d7ab2ce..b5d6c34510 100644
--- a/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java
+++ b/lrparser/org.eclipse.cdt.core.lrparser.tests/src/org/eclipse/cdt/core/lrparser/tests/ParseHelper.java
@@ -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);
}

Back to the top