Skip to content

ini: Predigest the INI-file to support Tcl's parse_ini() handling#3940

Open
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_ini-for-tcl
Open

ini: Predigest the INI-file to support Tcl's parse_ini() handling#3940
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_ini-for-tcl

Conversation

@BsAtHome
Copy link
Copy Markdown
Contributor

The new ini-file parser did away with the predigest in the linuxcnc script. 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 the linuxcnc script, 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 linuxcnc script 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant