forge icon indicating copy to clipboard operation
forge copied to clipboard

Support strings for keys

Open brettlangdon opened this issue 9 years ago • 3 comments

Right now we are limited in how we can name settings, basically [_a-zA-Z]+ is all we allow.

I have been thinking about allowing strings as identifiers. To allow for more complex key names.

"some-key@name" = "it's value";

Will probably keep references strict to just unquoted identifiers for now.

brettlangdon avatar Jul 02 '15 17:07 brettlangdon

Just making note, allowing quoted keys in references would end up looking like: "some-key@name"."another-key", I haven't thought of anything better.

brettlangdon avatar Jul 04 '15 12:07 brettlangdon

Well... looking at it again, unless we do "[email protected]" which is much better looking, but think it could be very easily confused.

brettlangdon avatar Jul 15 '15 01:07 brettlangdon

Allowing . in the keys is practical and helpful in real usage. No impact on references. However not sure of @, -, etc.

For example: Let's say we have only one identifier in nested namespace. Allowing . will transform following-

markdown {
  cache = true
}

into

markdown.cache = true

jeevatkm avatar Mar 22 '17 20:03 jeevatkm