Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Strict spacing for maps? #368

Closed
unlessgames opened this issue Nov 4, 2024 · 3 comments
Closed

Strict spacing for maps? #368

unlessgames opened this issue Nov 4, 2024 · 3 comments

Comments

@unlessgames
Copy link
Contributor

Hey, I really like what you are cooking here! Currently looking into koto to use as a live-coding language for a new framework.

Any particular reason the syntax is so strict about no-space before colons in maps, like error on {a : 10} in favor of {a: 10}? I feel like this is not aligned well with the otherwise forgiving and simple nature of the syntax.

@irh
Copy link
Contributor

irh commented Nov 4, 2024

Hey @unlessgames 👋 Glad you like the look of it! Live-coding is one of the main reasons I made Koto, please let me know how you get on.

I think there isn't really a good reason for the syntax to be strict here, especially with inline maps where parsing is generally flexible.

It should be a relatively simple change. peek_token / consume_token can become peek_next_token_on_same_line / consume_next_token_on_same_line in parser.rs), go ahead and make a PR if you like, or I can get to it later on.

@unlessgames
Copy link
Contributor Author

Neat, thanks! I submitted the PR.

@irh
Copy link
Contributor

irh commented Nov 5, 2024

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants