Skip to content

Commit

Permalink
Fix StringIndexOutOfBoundsException in -eval #25
Browse files Browse the repository at this point in the history
  • Loading branch information
birchb1024 committed Apr 27, 2019
1 parent 9499615 commit da81b3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/org/genyris/interp/Interpreter.java
Expand Up @@ -298,9 +298,11 @@ public Stack<Closure> resetDebugBackTrace() {
} }


public Exp evalStringInGlobalEnvironment(String script) throws GenyrisException { public Exp evalStringInGlobalEnvironment(String script) throws GenyrisException {
String truncatedScript = script;
if( script.length() > 9 )
truncatedScript = script.substring(0, 10) + "...";
InStream is = new UngettableInStream(new ConvertEofInStream(new IndentStream( InStream is = new UngettableInStream(new ConvertEofInStream(new IndentStream(
new UngettableInStream(new ReaderInStream(new StringReader(script), new UngettableInStream(new ReaderInStream(new StringReader(script), truncatedScript)), true)));
script.substring(0, 10) + "...")), true)));


Parser parser = newParser(is); Parser parser = newParser(is);
parser.setUsualPrefixes(this); parser.setUsualPrefixes(this);
Expand Down

0 comments on commit da81b3b

Please sign in to comment.