Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow alphabetical order in enums and in their corresponding match statements all over the compiler #1685

Open
mohammadfawaz opened this issue May 26, 2022 · 0 comments
Labels
code quality compiler: codegen Everything to do with IR->ASM, register allocation, etc. compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser

Comments

@mohammadfawaz
Copy link
Contributor

mohammadfawaz commented May 26, 2022

This may or may not make sense in some situations, but for the most part, it would be nice to have everything ordered alphabetically. This brings consistency and improves code readability.

e.g.

pub enum TypedDeclaration {
VariableDeclaration(TypedVariableDeclaration),
ConstantDeclaration(TypedConstantDeclaration),
FunctionDeclaration(TypedFunctionDeclaration),
TraitDeclaration(TypedTraitDeclaration),
StructDeclaration(TypedStructDeclaration),
EnumDeclaration(TypedEnumDeclaration),
Reassignment(TypedReassignment),

I think we already this properly in the sway-ir crate.

@mohammadfawaz mohammadfawaz added code quality compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser compiler: codegen Everything to do with IR->ASM, register allocation, etc. and removed compiler General compiler. Should eventually become more specific as the issue is triaged labels May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality compiler: codegen Everything to do with IR->ASM, register allocation, etc. compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler: parser Everything to do with the parser
Projects
Status: Todo
Development

No branches or pull requests

1 participant