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

Implement Constant expressions #13944

Open
5 of 22 tasks
hasithaa opened this issue Feb 27, 2019 · 3 comments
Open
5 of 22 tasks

Implement Constant expressions #13944

hasithaa opened this issue Feb 27, 2019 · 3 comments
Labels
Area/Compiler Planning/SwanLake2023 Temporary Label for issue to be fixed immediately. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/NewFeature Type/SpecDeviation

Comments

@hasithaa
Copy link
Contributor

hasithaa commented Feb 27, 2019

Tasks.

Constant support the following expressions.

  • literal
  • list-constructor-expr
  • mapping-constructor-expr
  • table-constructor-expr
  • string-template-expr
  • xml-expr
  • constant-reference-expr
  • type-cast-expr
  • unary-expr
  • multiplicative-expr
  • mod-expr
  • additive-expr
  • shift-expr
  • range-expr
  • numerical-comparison-expr
  • is-expr
  • equality-expr
  • binary-bitwise-expr
  • logical-expr
  • conditional-expr
  • ( const-expr )

Module constant declaration is partially implemented

  • support [public] const [type-descriptor] identifier = const-expr ;
@Shan1024 Shan1024 self-assigned this Feb 27, 2019
@anupama-pathirage anupama-pathirage added the Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. label Apr 30, 2019
@rdhananjaya rdhananjaya added this to the Ballerina 1.1.0 milestone Oct 17, 2019
@hasithaa hasithaa changed the title Implement const support Implement Constant expressions Oct 24, 2019
@hasithaa hasithaa added the Spec/2019R3 Related to Ballerina Spec 2019R3 label Oct 24, 2019
@hasithaa hasithaa removed this from the Ballerina 1.1.0 milestone Oct 24, 2019
@rdhananjaya
Copy link
Member

I think we also need to support constants of named integer subtypes.
As of swanlake alpha-4 it says constant cannot be defined with type 'int:Signed32', expected a simple basic types or a map of a simple basic type

@prakanth97
Copy link
Contributor

unary-expr is fixed in #30693. Shall update the description?

@gayalkuruppu
Copy link
Contributor

IMO constant expression list-constructor-expr here is a somewhat highly used scenario in coding. Better if we can prioritise that case. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Compiler Planning/SwanLake2023 Temporary Label for issue to be fixed immediately. Team/CompilerFE All issues related to Language implementation and Compiler, this exclude run times. Type/NewFeature Type/SpecDeviation
Projects
None yet
Development

No branches or pull requests

7 participants