Mercurial Hosting > luan
diff core/src/luan/LuanSource.java @ 190:04b86428dc50
minor
git-svn-id: https://luan-java.googlecode.com/svn/trunk@191 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Thu, 26 Jun 2014 18:20:54 +0000 |
parents | 3dcb0f9bee82 |
children | b48cfa14ba60 |
line wrap: on
line diff
--- a/core/src/luan/LuanSource.java Thu Jun 26 16:44:42 2014 +0000 +++ b/core/src/luan/LuanSource.java Thu Jun 26 18:20:54 2014 +0000 @@ -28,8 +28,13 @@ public final LuanSource source; public final int start; public final int end; + private final String text; public Element(LuanSource source,int start,int end) { + this(source,start,end,null); + } + + public Element(LuanSource source,int start,int end,String text) { if( source==null ) throw new NullPointerException("source is null"); this.source = source; @@ -38,10 +43,11 @@ end--; } this.end = end; + this.text = text; } public String text() { - return source.text.substring(start,end); + return text!=null ? text : source.text.substring(start,end); } @Override String location() {