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

Add Enum Support to Grammar #10

Open
pmqtt opened this issue Jan 3, 2025 · 0 comments
Open

Add Enum Support to Grammar #10

pmqtt opened this issue Jan 3, 2025 · 0 comments
Labels
good first issue Good for newcomers

Comments

@pmqtt
Copy link
Owner

pmqtt commented Jan 3, 2025

Add Enum Support to Grammar

Description: Extend the existing grammar to include enums, modeled after Rust's syntax. The enums should support:

  1. Variants without associated values (e.g., A).
  2. Variants with associated values (e.g., B(i64, string)).

Tasks:

  • Update the translation_unit in the EBNF grammar to include enum_definition.
  • Add rules for enum_variant and enum_variant_types.
    *Integrate enums as valid types for variable declarations.

Acceptance Criteria:

Grammar successfully parses enums like:

enum Result {
  Ok(i64),
  Err(string),
}
@pmqtt pmqtt added the good first issue Good for newcomers label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant