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

Bug: Cannot parse quotes in table name #3

Open
RogueMacro opened this issue Jun 13, 2020 · 4 comments
Open

Bug: Cannot parse quotes in table name #3

RogueMacro opened this issue Jun 13, 2020 · 4 comments

Comments

@RogueMacro
Copy link
Contributor

Error: Expected '.' or ']' to end table name, but got " instead (line 7) when parsing:

7    [Configs."grill add".Win32]
8    ConfigSelections = {Grill = {Config = "Debug"}}
@GlaireDaggers
Copy link
Owner

Are you sure you're on the latest version? This snippet is working on my end, the previous push added a bunch of test cases and fixes and should have fixed this exact bug.

@RogueMacro
Copy link
Contributor Author

Pulling the latest version gives me another issue; It fails to parse FileVersion = 1. I fixed it by adding

else if(node.Kind == .Int)
{
	output.AppendF("{}", node.GetInt().Value);
}

to TomlSerializer.Emit(), since it was parsing as a string, not an int. Therefore it threw an Unhandled error in result error.

@RogueMacro
Copy link
Contributor Author

RogueMacro commented Jun 14, 2020

This was also a problem;

[Configs]
grill add = { Win32 = { ConfigSelections = { Grill = { Config = "Debug" } } } }
grill install = { Win32 = { ConfigSelections = { Grill = { Config = "Debug" } } } }

Is not parsable, without quotes around grill add and grill install.

@GlaireDaggers
Copy link
Owner

Is that valid TOML? I had assumed it wasn't as the spec appears to have no examples of such a key. If that IS valid I can go ahead and support it though.

There might also be some problems in the serialization part, I hadn't revisited it since I revised a bunch of the parser & node code, I'll go back in and probably write some unit tests to ensure the serializer works as expected

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

No branches or pull requests

2 participants