-
Notifications
You must be signed in to change notification settings - Fork 18
Fix issues with nested properties #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
**Problem** I merged #18 a little too soon; It has 3 issues: 1. It doesn't handle comment lines between nested properties 2. It doesn't handle a blank (whitespace) after `=` in the nested property opener like the other forms of properties. 3. The test case was inserted in the wrong location in `eini_tests` module; it should have been in its own test function, and it should have had some error cases. **Solution** 1. Add support for comment lines in between nested properties. 2. Add support for blank after `=` in nested property opener. 3. Refactor and extend the tests for nested properties to cover more ground. **Known Issues** After I merged #18, I noticed this warning: ``` Compiled src/eini_lexer.xrl Parse action conflict scanning symbol blank in state 51: Reduce to properties_nested from property_nested (rule 28 at line 97) vs. shift to state 53, adding right sisters to property_nested. Conflict resolved in favor of shift. ``` It appears that the introduction of nesting has added some ambiguity to the grammar aroud the `blank`, and this change makes it a little worse: ``` Parse action conflict scanning symbol break in state 47: Reduce to single_value from blank (rule 44 at line 121) vs. shift to state 52, adding right sisters to blank. Conflict resolved in favor of shift. Parse action conflict scanning symbol blank in state 58: Reduce to properties_nested from property_nested (rule 30 at line 101) vs. shift to state 61, adding right sisters to property_nested. Conflict resolved in favor of shift. Parse action conflict scanning symbol comment in state 58: Reduce to properties_nested from property_nested (rule 30 at line 101) vs. shift to state 12, adding right sisters to property_nested. Conflict resolved in favor of shift. ``` Now there is some ambiguity around `comment` as well, and this appears to cause an issue parsing INI files with a comment line at the end of a block of nested properties when another (not-nested) key follows. I don't know if we should mark this as a known issue or not, but the trigger case is in a commented unit test in `eini_tests`.
|
@jimdigriz FYI. I looked at this issue for awhile and didn't come up with a really satisfactory refactor of the grammar to disambiguate these cases. It looks like it will be fairly rare that we encounter issues, so I am not sure how much to worry about it. |
|
tnx for foxing this up from prevolus one |
Thanks for looking into this, sorry for not capturing all edge cases. For me now that I it will parse my This though is your project, so if you want me to fix up my commits (based on your work here) I am happy to do so. |
No, that's totally alright, I'll just go ahead and merge this PR and raise a ticket for future follow up when I have a chance. |
* Updates eini to [1.2.9](https://github.com/erlcloud/eini/releases/tag/1.2.9) (see support nested properties, erlcloud/eini#19). * Updates `rebar.lock` format to 1.2.0 from the latest rebar3 versions.
* Updates eini to [1.2.9](https://github.com/erlcloud/eini/releases/tag/1.2.9) (see support nested properties, erlcloud/eini#19).
Problem
I merged #18 a little too soon; It has 3 issues:
=in the nested property opener like the other forms of properties.eini_testsmodule; it should have been in its own test function, and it should have had some error cases.Solution
=in nested property opener.Known Issues
After I merged #18, I noticed this warning:
It appears that the introduction of nesting has added some ambiguity to the grammar aroud the
blank, and this change makes it a little worse:Now there is some ambiguity around
commentas well, and this appears to cause an issue parsing INI files with a comment line at the end of a block of nested properties when another (not-nested) key follows. I don't know if we should mark this as a known issue or not, but the trigger case is in a commented unit test ineini_tests.