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

extract enum gpb atom missmatch #5

Open
sdancer opened this issue Sep 1, 2022 · 0 comments
Open

extract enum gpb atom missmatch #5

sdancer opened this issue Sep 1, 2022 · 0 comments

Comments

@sdancer
Copy link

sdancer commented Sep 1, 2022

  4         for i, c := range gleam_type.Constructors {
  5                 gpb_enum_name := enum.Values()[i].Name().LowerSnakeCase()
  6  
  7                 extract_patterns = append(extract_patterns, fmt.Sprintf("%s -> atom.create_from_string(\"%s\")", c.Render(), gpb_enum_name))
  8                 reconstruct_patterns = append(reconstruct_patterns, fmt.Sprintf("x if x == %s -> %s", gpb_enum_name, c.Render()))
  9                 reconstruct_vars = append(reconstruct_vars, fmt.Sprintf("let %s = atom.create_from_string(\"%s\")", gpb_enum_name, gpb_enum_name))
 10         }

easiest solution is to just extract to integer, otherwise, to sanitize the atoms in the same way gpb would do

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

No branches or pull requests

1 participant