Keyword list duplication
I have now had to copy-paste and reformat my list of keywords three times:
- Reject productions (the language doesn’t allow keywords to be used as identifiers anywhere)
- Follow restrictions
- Keyword completion
It would be great if at some point one can just write down the list of keywords once, and the rest is generated from this.
It would already be an improvement if
completion keyword
would accept a list of keywords, instead of requiring thecompletion keyword
term for every keyword separately. (correct me if I’m wrong, but I didn’t see a way to do this.)The third instantiation of the keyword list could possibly be removed by improving the -Completions.generated.esv file. Maybe the keywords could somehow be extracted from the lexical syntax and/or follow restrictions?
Submitted by Tobi Vollebregt on 24 September 2010 at 12:21
Issue Log
There is definitely room for improvement in SDF w.r.t. keywords. Maybe something to talk about offline? The completion keywords are a different matter: there you get redundancy because the syntax and completion are specified in different languages, in different files. Once you start reorganizing projects around language features, this may improve. One thing to note though is that
completion keyword
is mostly useless. When do you ever use code completion to insert thewhile
keyword? Thecompletion template
construct is more general, and can be used to insert a completewhile
loop template instead. As of0.5.3
the templates are more context-sensitive and you also get a bit of code completion on thecompletion template
construct which should help you write them. The tricky part is that you usually want to customize the layout and inserted names, so you can’t fully derive them from the grammar.
Log in to post comments