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

Parse function declarations without equals sign #280

Open
4 tasks
MeAmAnUsername opened this issue Apr 1, 2022 · 0 comments
Open
4 tasks

Parse function declarations without equals sign #280

MeAmAnUsername opened this issue Apr 1, 2022 · 0 comments
Labels
Component: DSL Something that concerns the design of PIE DSL Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request

Comments

@MeAmAnUsername
Copy link
Owner

Summary
Parse function declarations with a missing equals sign between the signature and the implementation.

Todo

  • Decide whether to allow omitting equals signs
  • Add tests
  • Implement
  • If allowed: add to documentation

Reason
Reason: many languages (including Java) do not have the =, so I expect many people new to PIE will not expect it to be required.

Description
Parse things like

func foo() -> int {
  9
}

This should either give an error (missing =) or be accepted as valid as well.
Currently thinking it is best not to accept it, as the current syntax makes it more clear what is actually happening.

Implementation
To allow omitting the equals sign, make = optional in the syntax and give an error in Statix analysis if it is not included unless the implementation matches PieFuncImpl(Block(_))

Search terms
parse, syntax, grammar, permissive, optional, omit, missing

Related issues

@MeAmAnUsername MeAmAnUsername added Type: enhancement New feature or request Status: proposal Enhancement in the proposal stage Component: DSL Something that concerns the design of PIE DSL Priority: low Component: editor labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: DSL Something that concerns the design of PIE DSL Component: editor Priority: low Status: proposal Enhancement in the proposal stage Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant