comparison core/src/luan/impl/LuanParser.java @ 260:f1f7d8c7e94e

add Io.protocols git-svn-id: https://luan-java.googlecode.com/svn/trunk@261 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 28 Oct 2014 23:25:13 +0000
parents e0fb8a49e031
children 82a3ebcfbafa
comparison
equal deleted inserted replaced
259:f9b201530b85 260:f1f7d8c7e94e
355 if( modName==null ) 355 if( modName==null )
356 return parser.failure(null); 356 return parser.failure(null);
357 int i = modName.lastIndexOf('/'); 357 int i = modName.lastIndexOf('/');
358 if( i == -1 ) 358 if( i == -1 )
359 i = modName.lastIndexOf('.'); 359 i = modName.lastIndexOf('.');
360 if( i == -1 )
361 i = modName.lastIndexOf(':');
360 String varName = modName.substring(i+1); 362 String varName = modName.substring(i+1);
361 if( !isValidName(varName) ) 363 if( !isValidName(varName) )
362 throw parser.exception("invalid variable name '"+varName+"' in import"); 364 throw parser.exception("invalid variable name '"+varName+"' in import");
363 LuanSource.Element se = se(start); 365 LuanSource.Element se = se(start);
364 FnCall require = new FnCall( se, new ConstExpr(se,PackageLuan.requireFn), new ConstExpr(se(start,modName),modName) ); 366 FnCall require = new FnCall( se, new ConstExpr(se,PackageLuan.requireFn), new ConstExpr(se(start,modName),modName) );