Closed Philogy closed 2 years ago
Thanks for pointing this out! @abigger87 fixed this thismorning in https://github.com/huff-language/huff-rs/pull/188, I also fixed constants as macro args in https://github.com/huff-language/huff-rs/pull/190. Should be in tonight's nightly build, or for now, can update to the stage branch with huffup -b stage
In the Huff by Example section of the docs under
Macros and Functions > Macros > Macro Arguments
it is mentioned that "Macro arguments may be one of: label, opcode, literal, or a constant" however it doesn't currently seem to be possible to use opcodes as macro arguments (as of huffc v0.2.0, latest version at time of writing).Specifically the lexer module of the Huff compiler does not recognize opcodes outside of the body of macros / functions at the moment (lexer reference). Personally I haven't dived deep enough into the codegen module so I'm unsure if there's any logic to support opcode args there already.
While this could be quite a useful feature in certain instances, it doesn't seem to be possible just yet.