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

Alternative keyword syntax for parselet and function definitions #108

Open
phorward opened this issue May 3, 2023 · 0 comments
Open

Alternative keyword syntax for parselet and function definitions #108

phorward opened this issue May 3, 2023 · 0 comments
Assignees
Labels
feature New feature or request syntax

Comments

@phorward
Copy link
Member

phorward commented May 3, 2023

In my aoc2022 wishlist, I proposed an alternative syntax to define parselets and functions in Tokay, using the keywords parselet and function.

The syntax is considered as alternative, because the grammar-style of Tokay's program files should still remain and used in first place.

The naming convention for parselet and function applies the same way as established.

parselet-keyword

# Current syntax
Statement : @<T> x = 1{
    # ...
}

# Alternative syntax
parselet Statement<T>(x = 1) {
    # ...
}

function-keyword

# Current syntax
get_index : @<x> i = 1, j = 2 {
    # ...
}

# Alternative syntax
function get_index<x>(i = 1, j = 2) {
    # ...
}
@phorward phorward added feature New feature or request syntax tokay labels May 3, 2023
@phorward phorward self-assigned this May 3, 2023
@phorward phorward removed the tokay label Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request syntax
Projects
None yet
Development

No branches or pull requests

1 participant