Mercurial Hosting > luan
diff core/src/luan/modules/BasicLuan.java @ 584:0742ac78fa69
add Luan.load_theme
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Wed, 12 Aug 2015 05:21:21 -0600 |
parents | 60c549d43988 |
children | 97c8ae330efe |
line wrap: on
line diff
--- a/core/src/luan/modules/BasicLuan.java Fri Jul 31 19:19:42 2015 -0600 +++ b/core/src/luan/modules/BasicLuan.java Wed Aug 12 05:21:21 2015 -0600 @@ -18,6 +18,7 @@ import luan.LuanMethod; import luan.LuanMeta; import luan.impl.LuanCompiler; +import luan.impl.ThemeParser; public final class BasicLuan { @@ -34,6 +35,14 @@ return LuanCompiler.compile(luan,new LuanSource(sourceName,text),env,allowExpr); } + public static LuanFunction load_theme(LuanState luan,String text,String sourceName) + throws LuanException + { + if( sourceName==null ) + sourceName = "THEME"; + return ThemeParser.compile(luan,new LuanSource(sourceName,text)); + } + public static LuanFunction load_file(LuanState luan,String fileName,Boolean addExtension) throws LuanException { if( fileName == null ) fileName = "stdin:";