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
Add '#cmdline "args..."' directive #341
Commits on Sep 4, 2021
-
fbc: #cmdline "args..." directive to specify command line arguments w…
…ithin source files - refactor parseArgsFromFile() and add parseArgsFromString() - #cmdline "args..." will invoke parseArgsFromString( "args..." )
-
fbc: sanitize whitespace for compiler source files changed in last co…
…mmit - fbc.bas, pp-cond.bas, pp.bas, pp.bi
-
fbc: internal change - replace fbc.bas:option_takes_argument() array …
…with cmdlineOptionTB() - cmdlineOptionTB() has type of FB_CMDLINE_OPTION type FBC_CMDLINE_OPTION takes_argument as boolean '' true = option requires argument allowed_in_source as boolean '' true = can be used with #cmdline directive restart_required as boolean '' true = restart of parser is required when used with #cmdline directive end type - WIP: initially set 'allowed_in_source' to FALSE for all options - WIP: initially set 'restart_required' to FALSE for all options
-
fbc: internal change #cmdline handling
- rename parseArgsFromString() to fbcParseArgsFromString(), it's a public re-entry point in to fbc main module - add is_source and is_file parameters to handleArg() - add is_source and is_file parameters to fbcParseArgsFromString() - add is_source parameter parseArgsFromFile()
-
fbc: add '-z nocmdline' command line option to ignore #cmdline direct…
…ives - allows overriding source directives with real fbc command line
-
-
fbc: #cmdline - restart the parser for some command line options
- track the module count and only process #cmdline directives in the first module - modules other than the first will ignore #cmdline directives with a warning - add #cmdline "-end" to trigger a restart of the parser - fbc doesn't know how to detect the end of all #cmdline directives to automatically trigger a restart
-
-
fbc: #cmdline - clean-up cmdlineOptionTB()
- #cmdline "-end" will trigger a restart of the parser - remaining !!!TODO!!!'s should only be for special cases and major restarts - error if #cmdline is used anywhere but module level
-
fbc: #cmdline - refactor 'restarts' to used restart flags instead of …
…restart count - add 'enum FB_RESTART_FLAGS' to track restart requests and restart history - FB_RESTART_FLAGS tracks if the restart is due to #cmdline or #lang - fbInit() expects a FB_RESTART_FLAGS argument instead of restart counts - in cmdlineOptionTB() add a member to indicate if fbc needs to be restarted for each option which would be the case for some options that need to be initialized even before the parser (currently not used)
-
fbc: #cmdline - fix restart after missing #cmdline "-end"
- if #cmdline "-end" was never given, then detect that a restart is required at the end of parsing the source - change the warning level for ignored #cmdline's - by default not shown but will show with '-w all'
-
Commits on Sep 5, 2021
-
fbc: #cmdline - internal naming changes
- rename the 'restart' procedures - declare sub fbRestartBeginRequest( byval flags as FB_RESTART_FLAGS ) - declare sub fbRestartAcceptRequest( byval flags as FB_RESTART_FLAGS ) - declare sub fbRestartCloseRequest( byval flags as FB_RESTART_FLAGS ) This should provide a readable sequence for restarting the parser or fbc: - Begin / Accept / Close - the underlying state for request/action/status to be updated through this interface
-
fbc: #cmdline - enable the remaining command line options that requir…
…e an fbc restart
-
fbc: #cmdline - remove the remaining limitations on options
- all command line options are allowed with #cmdline except '-help' and '-print' - not all options have been tested with #cmdline in a real test - added #cmdline "-restart" just in case #cmdline "-end" gives troubles - #cmdline "-end" will restart the parser or fbc if needed - #cmdline "-restart" will always restart fbc with the new command line options
-
- github freebasic#341: fbc: #cmdline "args..." directive to specify command line arguments within source files, restarting the parser from some options - github freebasic#341: fbc: #cmdline "-end" will trigger a parser or fbc restart if needed. fbc can't detect the end of reading all the #cmdlines to do this automatically - github freebasic#341: fbc: #cmdline "-restart" will always trigger an fbc restart - github freebasic#341: fbc: only process #cmdline in the first source module (which must be specified on the real command line) - github freebasic#341: fbc: add '-z nocmdline' command line option to ignore #cmdline directives - allows overriding source directives with real fbc command line