comparison core/src/luan/impl/LuanParser.java @ 271:82a3ebcfbafa

add internal tests git-svn-id: https://luan-java.googlecode.com/svn/trunk@272 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 31 Oct 2014 04:27:50 +0000
parents f1f7d8c7e94e
children 8afe9f2fdfec
comparison
equal deleted inserted replaced
270:b2c20fdcf42a 271:82a3ebcfbafa
1314 while( !parser.match(quote) ) { 1314 while( !parser.match(quote) ) {
1315 Character c = EscSeq(); 1315 Character c = EscSeq();
1316 if( c != null ) { 1316 if( c != null ) {
1317 buf.append(c); 1317 buf.append(c);
1318 } else { 1318 } else {
1319 if( !parser.anyChar() ) 1319 if( parser.test('\r') || parser.test('\n') || !parser.anyChar() )
1320 throw parser.exception("Unclosed string"); 1320 throw parser.exception("Unclosed string");
1321 buf.append(parser.lastChar()); 1321 buf.append(parser.lastChar());
1322 } 1322 }
1323 } 1323 }
1324 return parser.success(buf.toString()); 1324 return parser.success(buf.toString());
1343 return parser.success((char)Integer.parseInt(parser.textFrom(start+1),16)); 1343 return parser.success((char)Integer.parseInt(parser.textFrom(start+1),16));
1344 if( Digit() ) { 1344 if( Digit() ) {
1345 if( Digit() ) Digit(); // optional 1345 if( Digit() ) Digit(); // optional
1346 return parser.success((char)Integer.parseInt(parser.textFrom(start))); 1346 return parser.success((char)Integer.parseInt(parser.textFrom(start)));
1347 } 1347 }
1348 if( EndOfLine() )
1349 return parser.success('\n');
1348 return parser.failure(null); 1350 return parser.failure(null);
1349 } 1351 }
1350 1352
1351 private void Spaces(In in) throws ParseException { 1353 private void Spaces(In in) throws ParseException {
1352 while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() || in.parens && EndOfLine() ); 1354 while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() || in.parens && EndOfLine() );