-
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
problem with highlighting #11
Comments
I guess it is highlighted as an I dont know if word separator "atom" : {"autocomplete":true,"tokens":[/**/],"combine":"\\s" // combine using a space separator}
// "combine":false does not combine the tokens into one regular expression at all. Instead it matches one by one as single word, regardsless if they are simply prefix of a whole word, they will be matched PS: Also the ,"keyword" : {"autocomplete":true,"tokens":[
"если", "Если", "ЕСЛИ", "в случае", "иначе", "тогда", "содержит", "то", "хоть один из", "ни одного из" try sth like this: ,"keyword" : {"autocomplete":[/*put tokens here*/],"tokens":[
"RE::/если\\b/", "RE::/в\\sслучае\\b/"// do similar for other tokens. Unicode characters is a pain in the neck! |
Thanks for answer, but still exists problem. Tried this on https://regexr.com/. These patterns works well. (for string "привет если привет") |
Try sth like: "keyword": {"autocomplete":["если"],"tokens":[
"RE::/^(если)\\s/" // do similar for other keyword tokens
]} or try using unicode codes in regular expressions instead of the actual characters. You can use the online tool i pointed to in other issue to generate the unicode codes from a uniicode string NOTE: that above regex matches the keyword IF it is followed by a space, but it might be followed by a parenthesis or other delimiter eg bracket (or by EOL, end of line |
Hi, Nikos!
Could you help with one problem: i made json-file with grammar (include cyrillic symbols).
All works fine, but tokens "и", "И" behave strangely =)
In word "Привет" symbol "и" will be highlighted (but it's just a letter in this case) ((
Grammar:
`// 1. a partial javascript grammar in simple JSON format
var ldsl_grammar = // a partial javascript grammar in simple JSON format
{
// prefix ID for regular expressions used in the grammar
"RegExpID" : "RE::",
// Style model
"Style" : {
},
// Lexical model
"Lex" : {
},
// Syntax model (optional)
"Syntax" : {
},
// what to parse and in what order
"Parser" : [ ["ldsl"] ]
};`
The text was updated successfully, but these errors were encountered: