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

API: Add a representation for constant values (for semantic nodes) #179

Open
xFrednet opened this issue Jul 16, 2023 · 0 comments
Open

API: Add a representation for constant values (for semantic nodes) #179

xFrednet opened this issue Jul 16, 2023 · 0 comments
Labels
A-api Area: Stable API C-enhancement Category: New feature or request

Comments

@xFrednet
Copy link
Member

The API distinguishes between syntactic and semantic types. Syntactic types, like arrays, can have constant expressions as their index. In Marker these are called ConstExpr and are equivalent to rustc's AnonConst.

Semantic types and generic arguments can also contain constant values, which are the semantic equivalent to ConstExpr. Rustc uses rustc_middle::ty::consts::Const with a lot of fun nested variants. In the API I've now added a ConstValue struct as a placeholder, to add a proper representation later.

@xFrednet xFrednet added C-enhancement Category: New feature or request A-api Area: Stable API labels Jul 16, 2023
@xFrednet xFrednet changed the title API: Add a representation for constant values API: Add a representation for constant values (for semantic nodes) Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: Stable API C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant