Mercurial Hosting > luan
changeset 247:b5995d77878a
fix parsing of comments
git-svn-id: https://luan-java.googlecode.com/svn/trunk@248 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 10 Oct 2014 14:21:45 +0000 |
parents | 58752e3e4c5c |
children | 10cc873babee |
files | core/src/luan/impl/LuanParser.java dist/jars/luan-core-trunk.jar dist/jars/luan-logging-trunk.jar dist/jars/luan-lucene-trunk.jar dist/jars/luan-mail-trunk.jar dist/jars/luan-web-trunk.jar |
diffstat | 6 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
diff -r 58752e3e4c5c -r b5995d77878a core/src/luan/impl/LuanParser.java --- a/core/src/luan/impl/LuanParser.java Fri Oct 10 02:23:19 2014 +0000 +++ b/core/src/luan/impl/LuanParser.java Fri Oct 10 14:21:45 2014 +0000 @@ -227,9 +227,6 @@ parser.begin(); if( parser.match( ';' ) ) return parser.success(); - if( parser.match( "--" ) ) { - while( parser.noneOf("\r\n") ); - } if( EndOfLine() ) return parser.success(); parser.rollback(); @@ -1349,7 +1346,7 @@ } private void Spaces(In in) throws ParseException { - while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() || in.parens && NewLine() ); + while( parser.anyOf(" \t") || Comment() || ContinueOnNextLine() || in.parens && EndOfLine() ); } private boolean ContinueOnNextLine() { @@ -1357,16 +1354,17 @@ return parser.match('\\') && EndOfLine() ? parser.success() : parser.failure(); } - private boolean NewLine() { - if( !EndOfLine() ) - return false; + private boolean Comment() throws ParseException { + if( LongComment() ) + return true; if( parser.match("--") ) { while( parser.noneOf("\r\n") ); + return true; } - return true; + return false; } - private boolean Comment() throws ParseException { + private boolean LongComment() throws ParseException { parser.begin(); if( !parser.match("--[") ) return parser.failure();
diff -r 58752e3e4c5c -r b5995d77878a dist/jars/luan-core-trunk.jar Binary file dist/jars/luan-core-trunk.jar has changed
diff -r 58752e3e4c5c -r b5995d77878a dist/jars/luan-logging-trunk.jar Binary file dist/jars/luan-logging-trunk.jar has changed
diff -r 58752e3e4c5c -r b5995d77878a dist/jars/luan-lucene-trunk.jar Binary file dist/jars/luan-lucene-trunk.jar has changed