Skip to content
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

Command-line options should override !% headers #279

Open
erkyrath opened this issue Mar 17, 2024 · 2 comments
Open

Command-line options should override !% headers #279

erkyrath opened this issue Mar 17, 2024 · 2 comments

Comments

@erkyrath
Copy link
Contributor

Currently the compiler parses command-line options in order (including ICL files mentioned on the command line); then it opens the source file and parses !% headers; then it reopens the source file and compiles it.

This means that !% headers override command-line options. This is not intuitive. Normal procedure is that options ("easy to change") override options baked in a file ("hard to change").

Changing this will be a moderate pain though. Either we have to hold command-line options until a later stage of compilation, or keep track of the priority level of each set option.

On the up side, maybe we can systematize the big swaths of boilerplate option code in memory.c.

(Proposed as an alternative to #275 .)

@erkyrath
Copy link
Contributor Author

Might also clean up the DICT_WORD_SIZE_z, DICT_WORD_SIZE_g hack (where certain options have different defaults on the different platforms).

@erkyrath
Copy link
Contributor Author

erkyrath commented May 4, 2024

I have a branch for this: https://github.com/erkyrath/Inform6/tree/options-dat

This is a tiny change in behavior, but I took the opportunity to tidy up all the option-handling code (including options help and $LIST). The changelist is therefore pretty hefty and adds a whole new source file options.c. On the up side, adding a new option will be much easier.

I'd like to hold this until 6.43 is wrapped.

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

No branches or pull requests

1 participant