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

rawr: reserved words/characters #1

Open
conartist6 opened this issue Oct 6, 2021 · 4 comments
Open

rawr: reserved words/characters #1

conartist6 opened this issue Oct 6, 2021 · 4 comments

Comments

@conartist6
Copy link
Member

It seems that it would be prudent to reserve a few extra words or characters in templates. We will likely want to offer some features that can be accessed through the template. Off the top of my head I'd like to offer a way to print any members of the info object that have not already been printed. I'd also like to make sure I have room to offer some future builtin features for the templating engine, which means it would be good to carve out some additional special characters now.

@conartist6
Copy link
Member Author

Actually {...} seems like it would be a good way to denote printing the rest of the arguments for something, and it has the benefit of being illegal at present as . is assumed only to separate non-empty key parts.

@conartist6
Copy link
Member Author

Hmm no I don't think that's great. The problem is that it implies a level of control over formatting that I don't really want to give. I could implement rest as a second argument to rawr. It really has to be rawr that knows about it, because only rawr will understand which keys it has already printed.

@conartist6
Copy link
Member Author

conartist6 commented Oct 6, 2021

% might be a good one to reserve as it's commonly associated with formatting, i.e. sprintf-style, and there shouldn't be much downside to reserving it. I also think there's very-little downside to reserving |. In fact it wouldn't be so bad to exclude pretty much all the common specials that can't legally appear in an identifier, e.g. !@?#%^&*(){}[]<>,.\/'"`~

@conartist6
Copy link
Member Author

conartist6 commented Oct 6, 2021

If I do that though it might be a good idea to give quotes meaning immediately, i.e. as a way to specify a key so that only literal backslashes and quotes need be escaped inside. It might look like: {{'key&specia\ch@rs'}}. The argument against doing that is that it's not clear if anyone would really need or want the quote syntax. I can't think of a legit use case yet.

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

1 participant