changeset 636:13b390bfed32

parser fixes
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 01 Mar 2016 07:29:01 -0700
parents c83b8cefd922
children 6ea90dc10375
files core/src/luan/impl/LuanParser.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r c83b8cefd922 -r 13b390bfed32 core/src/luan/impl/LuanParser.java
--- a/core/src/luan/impl/LuanParser.java	Tue Mar 01 07:01:58 2016 -0700
+++ b/core/src/luan/impl/LuanParser.java	Tue Mar 01 07:29:01 2016 -0700
@@ -330,7 +330,10 @@
 		Var var = nameVar(start,RequiredName(In.NOTHING));
 		while( parser.match( '.' ) ) {
 			Spaces(In.NOTHING);
-			var = indexVar( start, expr(var.expr()), NameExpr(In.NOTHING) );
+			Expr exp = NameExpr(In.NOTHING);
+			if( exp==null )
+				return parser.failure(null);
+			var = indexVar( start, expr(var.expr()), exp );
 		}
 		Settable fnName = var.settable();
 
@@ -854,6 +857,7 @@
 			exp2 = NameExpr(in);
 			if( exp2!=null )
 				return parser.success(indexVar(start,expr(exp1),exp2));
+			return parser.failure(null);
 		}
 		FnCall fnCall = Args( in, start, expr(exp1), new ArrayList<Expressions>() );
 		if( fnCall != null )