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

feat: parse_as_tbl function to parse tables that can be looped over #13

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

mrcjkb
Copy link
Member

@mrcjkb mrcjkb commented Mar 25, 2024

We can replace the toml dependency in rocks.nvim with this (see nvim-neorocks/rocks.nvim#166).

@mrcjkb mrcjkb force-pushed the toml_read branch 2 times, most recently from bc5c46c to 1a66cb2 Compare March 25, 2024 23:00
@@ -159,13 +159,24 @@ pub fn toml_edit(lua: &'static Lua) -> Result<mlua::Table> {
table.set(
"parse",
lua.create_function(|lua, str: mlua::String| {
let document: Document = match str.to_string_lossy().parse() {
let document: DocumentMut = match str.to_string_lossy().parse() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document has been deprecated.

@mrcjkb
Copy link
Member Author

mrcjkb commented Mar 26, 2024

Another option might be to make the toml table the basis for the one returned by parse. Then we could just use that.

But it would mean there would be two sources of truth and we'd have to make sure __index and __newindex update it, which might be a bit complicated.

@vhyrro vhyrro merged commit 768e81f into nvim-neorocks:main Apr 3, 2024
2 of 3 checks passed
@mrcjkb mrcjkb deleted the toml_read branch April 3, 2024 17:19
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