in-ini: support unquoted empty values
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 14 Nov 2020 12:51:17 +0100
changeset 113871c05ca7118
parent 112 bf2240a0471d
child 114 c3a2c32afaae
in-ini: support unquoted empty values
java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java
     1.1 --- a/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Nov 14 02:10:31 2020 +0100
     1.2 +++ b/java/alt2xml-in-ini/src/cz/frantovo/alt2xml/in/ini/Reader.java	Sat Nov 14 12:51:17 2020 +0100
     1.3 @@ -175,7 +175,7 @@
     1.4  		ENTRY(
     1.5  				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*\"(?<value>[^']+)\"\\s*((;|#)\\s*(?<comment>.*))?", // quoted value → include spaces + might have comment
     1.6  				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*'(?<value>[^']+)'\\s*((;|#)\\s*(?<comment>.*))?", // apostrophed value → include spaces + might have comment
     1.7 -				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*(?<value>.+)" // unquoted value → strip spaces + no comments
     1.8 +				"\\s*(?<key>[^=\\]]+?[^=\\s\\]]*)(\\[(?<subkey>[^\\]]+)\\])?\\s*=\\s*(?<value>.*)" // unquoted value → strip spaces + no comments
     1.9  		) {
    1.10  					@Override
    1.11  					public void processLine(LineContext lc, FileContext fc) throws SAXException {