Permalink
Browse files

Merge branch 'development' of github.com:aptana/studio3-ruby into dev…

…elopment
  • Loading branch information...
2 parents e02e8cf + 79dd223 commit cf78d0f647adb1b6ea91599cce526b2c39d71a5c Kevin Lindsey committed Jun 28, 2011
@@ -71,7 +71,7 @@ private String getDisplayText(ERBScript script)
String source = new String(fParseState.getSource());
// locates the ruby source
IRubyScript ruby = script.getScript();
- source = source.substring(ruby.getStartingOffset(), ruby.getEndingOffset());
+ source = source.substring(ruby.getStartingOffset(), ruby.getEndingOffset() + 1);
// gets the first line of the ruby source
StringTokenizer st = new StringTokenizer(source, "\n\r\f"); //$NON-NLS-1$
source = st.nextToken();
@@ -47,7 +47,7 @@ protected IParseNode processEmbeddedlanguage(IParseState parseState) throws Exce
if (root == null)
{
root = new ParseRootNode(IRubyConstants.CONTENT_TYPE_RUBY, new ParseNode[0], startingOffset,
- startingOffset + source.length());
+ startingOffset + source.length() - 1);
}
processRubyBlock(root);
break;
@@ -34,7 +34,7 @@ public IParseRootNode parse(IParseState parseState) throws Exception
{
String source = new String(parseState.getSource());
RubyScript root = new RubyScript(parseState.getStartingOffset(), parseState.getStartingOffset()
- + source.length());
+ + source.length() - 1);
RubyStructureBuilder builder = new RubyStructureBuilder(root);
SourceElementVisitor visitor = new SourceElementVisitor(builder);
@@ -172,7 +172,7 @@ public void testRegex() throws Exception
IParseNode result = fParser.parse(fParseState);
assertEquals(IRubyElement.SCRIPT, result.getNodeType());
assertEquals(0, result.getStartingOffset());
- assertEquals(59, result.getEndingOffset());
+ assertEquals(58, result.getEndingOffset());
}
public void testCase() throws Exception
@@ -182,7 +182,7 @@ public void testCase() throws Exception
IParseNode result = fParser.parse(fParseState);
assertEquals(0, result.getStartingOffset());
- assertEquals(60, result.getEndingOffset());
+ assertEquals(59, result.getEndingOffset());
}
public void testWhile() throws Exception

0 comments on commit cf78d0f

Please sign in to comment.