Macro imporvements - #92
Open
Proletcultist wants to merge 5 commits into
Open
Conversation
Added macro stack as ExpandMacroVisitor field, added macro stack as argument for all macro instructions. Added mpush and mpop macro instructions with functionality same as in CdM-8 macro processor.
- Add list of include paths (paths, where macroprocessor will search for files included into processed file) as argument for `assemble_files` - Add same argument for `assemble_module` and `process_macros` - Add `nested` argument for `process_macros`. This argument is True, when we process file to insert it into another file. The only thing this argument affect is placing line marks with `mstart` and `mstop` labels: when we process file for insertion it into another file, we mustn't produce this marks, instead we must produce only mark which marks end of expanded text from some macro or another file - Add `nested` and `include_paths` as fields of `ExpandMacrosVisitor` class, respectively add arguments for `__init__` of this class - Add `init_ctx: ExpandMacrosVisitor` as argument for `process_macros`. When this argument passed, ExpandMacrosVisitor used by this function will share macros, macro_stack and nonce value with `init_ctx`. This used for sharing this vars when we process included file - Add include_file function, which macroprocess specified file in context of current file processing and returns text of processed file. This function is called instead of `expand_macro` if instructions in some line is `include`
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.
Add
mpush,mpopandincludemacro directives, add info about macros and macro libs to docs.