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

Allow users to use upper case opcodes like ADD without breaking the compiler #245

Open
misirov opened this issue Jan 30, 2023 · 3 comments
Labels
lexer Huff Lexer Changes. parser Huff Parser Related.

Comments

@misirov
Copy link

misirov commented Jan 30, 2023

Related to Allow users to use PUSH opcode without breaking the compiler.
Allow users to scream their opcodes out loud. Compiler could translate all uppercase ADD instances to lowercase add.

Error: Unmatched Jump Label
-> ./huff-project-template/src/Test.huff:2446-2449
       |
  > 57 |     ADD                 // [0000000000000000000000000000000000000000000000000000000000000021]
       |
@misirov misirov changed the title Allow users to use upper case opcodes like ADD Allow users to use upper case opcodes like ADD without breaking the compiler Jan 30, 2023
@Maddiaa0 Maddiaa0 added lexer Huff Lexer Changes. parser Huff Parser Related. labels Jan 30, 2023
@AbhinavMir
Copy link

Wouldn't text-based non-ambiguity be better in terms of compiler design, in that either keep it x or y? Probably nitpicking here.

@jtriley-eth
Copy link
Contributor

I would argue it would be best to keep it lowercase since uppercase is reserved for user-defined macros, constants, etc. As @AbhinavMir mentioned, this is less ambiguous to do one or the other and toggling caps-lock just for instructions would be slower to write.

@misirov
Copy link
Author

misirov commented Mar 30, 2023

Fair enough. If this is a standard to follow and changing it introduces unnecessary complexity then it would make sense to keep it as is.

For context, myself (and others I know) are used to uppercase opcodes and default to them when doing context switching, so it's more of a dev UX nitpick than anything else. @jtriley-eth

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lexer Huff Lexer Changes. parser Huff Parser Related.
Projects
None yet
Development

No branches or pull requests

4 participants