comparison src/luan/lib/BasicLib.java @ 14:2ddf85634d20

whitespace handling; comments; if/while/repeat statements; git-svn-id: https://luan-java.googlecode.com/svn/trunk@15 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 26 Nov 2012 10:18:46 +0000
parents 3b22ffbdb83a
children a7c13c6017f7
comparison
equal deleted inserted replaced
13:3b22ffbdb83a 14:2ddf85634d20
48 } 48 }
49 49
50 public static LuaFunction load(String ld) throws LuaException { 50 public static LuaFunction load(String ld) throws LuaException {
51 LuaParser parser = Parboiled.createParser(LuaParser.class); 51 LuaParser parser = Parboiled.createParser(LuaParser.class);
52 ParsingResult<?> result = new ReportingParseRunner(parser.Target()).run(ld); 52 ParsingResult<?> result = new ReportingParseRunner(parser.Target()).run(ld);
53 // ParsingResult<?> result = new TracingParseRunner(parser.Target()).run(ld);
53 if( result.hasErrors() ) 54 if( result.hasErrors() )
54 throw new LuaException( ErrorUtils.printParseErrors(result) ); 55 throw new LuaException( ErrorUtils.printParseErrors(result) );
55 Object resultValue = result.resultValue; 56 Object resultValue = result.resultValue;
56 if( resultValue instanceof Expressions ) { 57 if( resultValue instanceof Expressions ) {
57 final Expressions expressions = (Expressions)resultValue; 58 final Expressions expressions = (Expressions)resultValue;