Mercurial Hosting > luan
comparison src/luan/interp/LuanParser.java @ 124:f537ff5e511d
minor cleanup
git-svn-id: https://luan-java.googlecode.com/svn/trunk@125 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 06 Jun 2014 03:41:04 +0000 |
parents | 8d7730a5e3b4 |
children | bcb3a09d0caf |
comparison
equal
deleted
inserted
replaced
123:d7be9b3abf1a | 124:f537ff5e511d |
---|---|
9 import luan.Luan; | 9 import luan.Luan; |
10 import luan.LuanState; | 10 import luan.LuanState; |
11 import luan.LuanSource; | 11 import luan.LuanSource; |
12 import luan.parser.Parser; | 12 import luan.parser.Parser; |
13 import luan.parser.ParseException; | 13 import luan.parser.ParseException; |
14 import luan.lib.PackageLib; | |
15 | 14 |
16 | 15 |
17 final class LuanParser { | 16 final class LuanParser { |
18 | 17 |
19 private static final class Frame { | 18 private static final class Frame { |
303 | 302 |
304 private Stmt ImportStmt() throws ParseException { | 303 private Stmt ImportStmt() throws ParseException { |
305 int start = parser.begin(); | 304 int start = parser.begin(); |
306 if( !Keyword("import") ) | 305 if( !Keyword("import") ) |
307 return parser.failure(null); | 306 return parser.failure(null); |
308 Expr importExpr = new ConstExpr(se(start),PackageLib.require); | 307 Expr importExpr = (Expr)nameVar(start,"require").expr(); |
309 String modName = StringLiteral(false); | 308 String modName = StringLiteral(false); |
310 if( modName==null ) | 309 if( modName==null ) |
311 return parser.failure(null); | 310 return parser.failure(null); |
312 String varName = modName.substring(modName.lastIndexOf('.')+1); | 311 String varName = modName.substring(modName.lastIndexOf('.')+1); |
313 LuanSource.Element se = se(start); | 312 LuanSource.Element se = se(start); |