comparison core/src/luan/impl/LuanParser.java @ 320:fed1893821bf

remove global namespace git-svn-id: https://luan-java.googlecode.com/svn/trunk@321 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 06 Feb 2015 21:54:41 +0000
parents 8afe9f2fdfec
children 7f7708e8fdd4
comparison
equal deleted inserted replaced
319:f6db49c294a7 320:fed1893821bf
248 Stmt stmt; 248 Stmt stmt;
249 if( (stmt=ReturnStmt()) != null 249 if( (stmt=ReturnStmt()) != null
250 || (stmt=FunctionStmt()) != null 250 || (stmt=FunctionStmt()) != null
251 || (stmt=LocalFunctionStmt()) != null 251 || (stmt=LocalFunctionStmt()) != null
252 || (stmt=ImportStmt()) != null 252 || (stmt=ImportStmt()) != null
253 || (stmt=JavaStmt()) != null
253 || (stmt=BreakStmt()) != null 254 || (stmt=BreakStmt()) != null
254 || (stmt=ForStmt()) != null 255 || (stmt=ForStmt()) != null
255 || (stmt=TryStmt()) != null 256 || (stmt=TryStmt()) != null
256 || (stmt=DoStmt()) != null 257 || (stmt=DoStmt()) != null
257 || (stmt=WhileStmt()) != null 258 || (stmt=WhileStmt()) != null
383 for( int i=1; i<s.length() ; i++ ) { 384 for( int i=1; i<s.length() ; i++ ) {
384 if( !('a'<=c && c<='z' || 'A'<=c && c<='Z' || c=='_' || '0'<=c && c<='9') ) 385 if( !('a'<=c && c<='z' || 'A'<=c && c<='Z' || c=='_' || '0'<=c && c<='9') )
385 return false; 386 return false;
386 } 387 }
387 return true; 388 return true;
389 }
390
391 private Stmt JavaStmt() throws ParseException {
392 parser.begin();
393 if( !Keyword("java",In.NOTHING) )
394 return parser.failure(null);
395 return parser.success( new JavaStmt() );
388 } 396 }
389 397
390 private Stmt BreakStmt() throws ParseException { 398 private Stmt BreakStmt() throws ParseException {
391 parser.begin(); 399 parser.begin();
392 if( !Keyword("break",In.NOTHING) ) 400 if( !Keyword("break",In.NOTHING) )
1146 "function", 1154 "function",
1147 "goto", 1155 "goto",
1148 "if", 1156 "if",
1149 "import", 1157 "import",
1150 "in", 1158 "in",
1159 "java",
1151 "local", 1160 "local",
1152 "nil", 1161 "nil",
1153 "not", 1162 "not",
1154 "or", 1163 "or",
1155 "repeat", 1164 "repeat",