Skip to content

Macro imporvements - #92

Open
Proletcultist wants to merge 5 commits into
cdm-processors:masterfrom
Proletcultist:master
Open

Macro imporvements#92
Proletcultist wants to merge 5 commits into
cdm-processors:masterfrom
Proletcultist:master

Conversation

@Proletcultist

Copy link
Copy Markdown

Add mpush, mpop and include macro directives, add info about macros and macro libs to docs.

Proletcultist and others added 5 commits April 2, 2025 19:57
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`
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