From 0285af245aaf649c0528575ff7bd03838b31c743 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 15 Jan 2015 17:27:53 -0800 Subject: Implement new rules for bare key names * Key names are restricted to [a-zA-Z0-9_-] * Equal signs must be on the same line (as must the next value) as the key * Quoted keys are allowed and are parsed as basic strings. Closes #48 --- tests/valid/hard_example.toml | 6 +++--- tests/valid/key-special-chars.toml | 2 +- tests/valid/key-with-pound.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/valid/hard_example.toml b/tests/valid/hard_example.toml index 1d5d8e9..6c47b2c 100644 --- a/tests/valid/hard_example.toml +++ b/tests/valid/hard_example.toml @@ -12,9 +12,9 @@ test_string = "You'll hate me after this - #" # " Annoying, isn't it? another_test_string = " Same thing, but with a string #" harder_test_string = " And when \"'s are in the string, along with # \"" # "and comments are there too" # Things will get harder - + [the.hard.bit#] - what? = "You don't think some user won't do that?" + "what?" = "You don't think some user won't do that?" multi_line_array = [ "]", # ] Oh yes I did @@ -30,4 +30,4 @@ test_string = "You'll hate me after this - #" # " Annoying, isn't it? # "or here, # and here" # ] End of array comment, forgot the # -#number = 3.14 pi <--again forgot the # +#number = 3.14 pi <--again forgot the # diff --git a/tests/valid/key-special-chars.toml b/tests/valid/key-special-chars.toml index 8b3fc51..dc43625 100644 --- a/tests/valid/key-special-chars.toml +++ b/tests/valid/key-special-chars.toml @@ -1 +1 @@ -~!@#$^&*()_+-`1234567890[]\|/?><.,;:' = 1 +"~!@#$^&*()_+-`1234567890[]\\|/?><.,;:'" = 1 diff --git a/tests/valid/key-with-pound.toml b/tests/valid/key-with-pound.toml index 1c54f53..65b766f 100644 --- a/tests/valid/key-with-pound.toml +++ b/tests/valid/key-with-pound.toml @@ -1 +1 @@ -key#name = 5 +"key#name" = 5 -- cgit v1.2.3