-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support non-standard features. #3
Comments
Hey, thanks for the suggestion! I'm generally hesitant to add non-standard features to However I am open to the idea of adding non-standard features if they are sufficiently common in both usage and implementation, forming a kind of "community standard". Here are my thoughts regarding the particular keywords/syntax you want added: Import KeywordSeems like it would be straightforward to add, I could just designate it a
If enough people added an A quick scan through the lox implementations list didn't yield any implementations that used an Array SyntaxSeems a lot more tricky. Not only is it harder to add (although frankly still pretty easy depending on what we want the behavior to look like. After all JS arrays have already been implemented in VS Code), but as it's a much larger feature than an import keyword, there's way more room for implementation inconsistencies. Just because two implementations may use bracket syntax for initialization, that doesn't mean they use a similar syntax for indexing and vice versa. Configuration
It definitely seems tricky. A quick google search gives me the impression that VS Code doesn't officially support any dynamic syntax highlighting. Although we may be able to do it using decorators, it seems more like a hack rather than something officially supported. You're welcome to try to implement it, I would be more than happy to add Forking GuideWhat this issue comes down to is that as Crafting Interpreters is ultimately a guide on how to make your own, personalized programming language, there is no one-size-fits-all syntax highlighter that will work on all lox language variations. This extension is mostly geared to help people write programs as they work through the contents of the book, not as they add features outside the scope of the book. That said the book and I both want to encourage people to add cool new features to their language. Although the Lox Language extension won't be able to fit everyone's needs, it would be a great starting point for people to write their own syntax highlighters. One way to solve both your needs, and potentially the needs of other lox implementers (loxers?) would be to write a guide on how fork |
I think a forking guide would be an excellent idea; instead of adding non-standard features, that not everybody might want in their current form. Ideally I would not want to make this plugin more complex than it needs to be, so I'd rather not add 'complex' Decorators. I think a forking guide would be in the spirit of lox and would be a rather excellent idea. Let me know if you need any help on it, reviewing, testing or otherwise. |
I would love support for both the
import
keyword and array syntax ([...]
).Both are non-standard but pretty common; ideally I would like a configuration option to turn on; however I don't know if this is possible.
The text was updated successfully, but these errors were encountered: