Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Feat/cli label indices #274

Merged
merged 6 commits into from
Apr 25, 2023

Conversation

merklefruit
Copy link
Contributor

Overview

Adds a huff_cli flag to print the jump labels and their respective PC offset. Works for the MAIN macro.

Closes #231

Usage Example

cargo run ./huff-examples/erc20/contracts/ERC20.huff --label-indices

Output:

------ JUMP LABEL INDICES ------
  allowance: 0x18e
  approve: 0x177
  balanceOf: 0x14e
  error: 0xd8
  is_owner: 0xed
  mints: 0xde
  totalSupply: 0x16b
  transfer: 0x48
--------------------------------

Notes / open questions

  • The output format (what gets printed by the command) could be better, I'm not sure if there is a standard I should follow, looking for feedback on this
  • Is support for the MAIN macro sufficient or should this command include all macros?

huff_cli/src/huffc.rs Outdated Show resolved Hide resolved
huff_cli/src/huffc.rs Outdated Show resolved Hide resolved
Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like really nice work. Thank you for doing this ser!!!!!

huff_cli/src/huffc.rs Outdated Show resolved Hide resolved
Copy link
Member

@Maddiaa0 Maddiaa0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay for the re-review! This looks great!

@Maddiaa0 Maddiaa0 merged commit 894ed88 into huff-language:stage Apr 25, 2023
@merklefruit merklefruit deleted the feat/cli-label-indices branch April 26, 2023 07:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants