-
Notifications
You must be signed in to change notification settings - Fork 17
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
Language syntax #26 #34
Conversation
Initial thoughts after first glimpse; it seems like there is a one to one relation for syntax plugin and language. (In, say a maven project, we could have .java, .xml, .html, .js and .css files...) |
Now you're able to build a custom comment syntax that can include all the comments you wish to support for a plugin. It defaults to Java single line comments if no syntax is given. One way to improve might be by creating an enum to store the different comment regexes for all languages, so that if two plugins use the same language, they would not have to come up with the regex again. Not sure if using enums like this is a good practice? |
Awesome! What I'm not fully sure about though is whether we want or need to have each different language plugin to say "I'm Going to allow there kind of syntaxes" but rather just have a set of plugins, each defined for a set of file-extensions so that it would just ask "Hey, I have this .js file - who wants to parse it" That being said, it might be too early for that... -- anyways the builder makes building and adding these much nicer task! |
I'm not sure what's the best way to do that. Should the file extension be checked in prepareStubFile() and prepareSolutionFile() and only create a CommentSyntax (or maybe get from a mapping of some sort) after checking the extension every time? |
For both, stubs and solutions we need to process the files.. We could have a A nice way with annotations and reflection could be to have |
Revert "Merge pull request #34 from DarthKipsu/lang-syntax"
This is a fix for #26
Language comment styles are passed on using LanguageSyntax, this will require only new comment regexes to be added when creating a new language plugin. I have not yet added the syntax files for any of the plugins as I'm worried it will break any current exercises if the syntax for the comments is suddenly changed. For backwards compatibility, should single line java comments always be accepted?