ini: Predigest the INI-file to support Tcl's parse_ini() handling#3940
Open
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
Open
ini: Predigest the INI-file to support Tcl's parse_ini() handling#3940BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new ini-file parser did away with the predigest in the
linuxcncscript. The problem is that there is yet another ini-file parser in the code base, this time in Tcl (tcl/linuxcnc.tcl.in:parse_ini()). The Tcl ini-parser is very much inadequate to handle and enforce the new format. Instead, a predigest is once again performed in thelinuxcncscript, including all necessary grammar checks by using the inivalue program to regenerate the content. The generated ini-file is only used by the Tcl ini-parser.Predigesting and outputting a flattened version should be compatible with the "old" way of doing things, but fixes the incompatibilities, for now. The Tcl ini-parser, and code that reads variables, does not perform any type checking. Therefore, the Tcl code may get things completely wrong and using it should be avoided. The Tcl ini-parser must be eliminated, but that is another project.
A small addition is made to the
linuxcncscript in that it will exit when it cannot properly parse the supplied ini-file. Exiting early on is better than trying to perform some bad action(s) when the ini-file parses with errors. There should be an error message printed when such an event occurs with filename and line number of the error.This PR replaces #3938, which tried to solve the issue, but only managed to address a small part of the actual problem.
This PR replaces #3939, which is a simple one-liner fix for a typo.