-
Notifications
You must be signed in to change notification settings - Fork 91
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
MPL Languages support #280
Comments
... user-defined words - you called it |
@tomasr perhaps it's all my poor english, so are you need some clarifications? |
I've refactored and added this now in the develop branch. |
I'm so sorry. It was my fault. After installing patched viasfora, VS "reinstalled" it from marketplace. |
For now, C-String-parser works fine. Also, invalid escape-sequences (supported by C but not by MLP) don't highlighted at all. So I think you did it. You must update readme.md by adding MPL in the list of supported languages. User-defined words -- i'll check it later, and if it is work as expected then I'll close the issue. |
I just reused the C string parser for escape sequences for now. A simplified version that only supports the MPL escape sequences should be easy to write if needed. From what little I looked at yesterday, seems like it essentially only supports |
Yes, it supports only |
|
I've finally done some improvements here:
Changed to do case-sensitive comparisons, as suggested.
I've now excluded labels when looking for keywords.
This isn't really possible, since I'm not doing a full parser for the language. Right now, I rely on the underlying MPL parser to tell me what is a language keyword so that I can analyze it further. Supporting arbitrary words would require parsing the actual grammar to understand what's what, which I'm not keen on doing.
I've simplified the string scanner here to only support |
Thanks.
For this, i think we need just a lexer, isn't it? By the way, the current state of mpl support, with the last changes you've made, can be released in the new version of viasfora. And the supporting arbitrary words can be added in another future version. |
In the general case, no, it's likely not enough, because you need to not only tokenize the text, but also understand context of how stuff is used. I really don't want to have to write an entire lexer / parser for each and every single language Viasfora supports :( |
Thanks, i will test the changes for some time, and if it is ok, then i will close the issue. |
I have been tried to add support of MPL Languages in viasfora, but:
After reinstating of MPL-plugin, viasfora (for MPL) didn't highlight anything at all til viasfora's reinstalling.My MPL Patch don't provide you with support of user-defined words, and escape-sequences, but for sake of test you can use any string parser from viasfora. Also, you can define any user-defined words as you prefer.
MPL - https://gravilink.com
MPL-Plugin - (use vs2019) https://marketplace.visualstudio.com/items?itemName=Matway.mpl-vs
MPL Examples - https://github.com/Matway/mpl-sl/blob/master/control.mpl
MPL Grammar - https://gravilink.com/mplGrammar.2017-07-01.xhtml
Short grammar:
String ::= '"' ( '\\' | '\"' | [^"\] )* '"'
String is a sequence of any characters enclosed in
""
."
and\
can be escaped with\
. For example"this is a string with \" quote"
and"this is a string with \\ slash"
Comment ::= '#' any characters but CR and LF
MPL patch:
The text was updated successfully, but these errors were encountered: