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

Added implicit map parsing mode #10

Merged
merged 3 commits into from
Apr 18, 2023
Merged

Conversation

ecton
Copy link
Member

@ecton ecton commented Apr 17, 2023

Closes #6

ecton added 2 commits April 18, 2023 09:06
This commit adds the concept of an implicit map -- detecting where the
root starts with `Identifier Colon` and switching into map parsing.

I commented on khonsulabs#6 about the remaining "edge case" I hadn't thought of --
handling of commas vs new lines in this mode. Currently, commas are
still required, and whitespace is insignificant, but this likely will be
updated to support removing commas between key-value pairs as long as
there's an end-of-line.
This commit changes implicit map parsing to be its own logic, and forces
implicit map keys to be identifiers. Forcing keys to be identifiers
removes a little bit of ambiguity since all whitespace is insignificant
beyond providing a way to separate tokens.
src/de.rs Show resolved Hide resolved
@ecton ecton marked this pull request as ready for review April 18, 2023 17:00
@ecton ecton merged commit 3a9d580 into khonsulabs:main Apr 18, 2023
@ecton ecton deleted the implicit-map branch April 18, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Omit top level struct
2 participants