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

Move token and lexer to separate packages #98

Closed
wants to merge 2 commits into from

Conversation

moorereason
Copy link
Contributor

This commit is massive, but relatively simple. It moves the main token and lexer into their own sub-packages.

@pelletier
Copy link
Owner

I'm iffy about that change because it means making public a lot of internal functions, which would make changing without breaking backward compatibility more difficult in the future.

What's the motivation to pull those into sub-packages?

@moorereason
Copy link
Contributor Author

Ultimately, my goal is to pattern a token, lexer/scanner, ast, and parser (and printer) after Go. I should probably have discussed this with you beforehand, but I figured you would ask such as question. 😊

One of the main motivators is that I want to be able to read in a TOML file, modify a field in the AST, and then output the results while maintaining comments and the general structure (as in, don't sort the keys or lose comments in output). I would like to have a tomlfmt in the end.

But having said all of that, you've raised a concern about the API that I hadn't considered. I was trying to make this move without changing too many things at once, but I think that would only create more problems. Tunnel vision.

I'll close this PR and rethink the API of these two packages. If you're not interested in where I'm headed, just let me down easy. 😉

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.

2 participants