mayah / tinytoml

A header only C++11 library for parsing TOML
BSD 2-Clause "Simplified" License
167 stars 31 forks source link

Fix a small mistake in judgement of table keys #19

Closed peria closed 7 years ago

peria commented 7 years ago

Current Value::escapeKey() has a small issue to escape all keys which include '_'. Although it is acceptable in spec, I think it is not an intended behavior.

So what we can choose is either of

  1. keep current behavior
  2. do not escape keys just because of '_'.

If you want 1, we need to remove unnecessary condition c != '_' && on 1222nd line, but I want to choose 2 in this PR. I also added a simple test case to check it.

PTL.

veeg commented 7 years ago

Doh >.<