Skip to content
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

Sequence query #13

Open
Fandangi opened this issue Oct 3, 2018 · 3 comments
Open

Sequence query #13

Fandangi opened this issue Oct 3, 2018 · 3 comments

Comments

@Fandangi
Copy link

Fandangi commented Oct 3, 2018

In the following line, I am trying to catch 'var', '=' and 'somevar' separately and assign styles.

var=somevar

I have defined in the lex section 'var', eq and 'subs', and these work well.

    ,"var"                      	: "RE::/(var)(?:(?=\\s)|(?=\\t)|(?==)|$)/gim"
    ,"eq"                      		: "RE::/\\s*=\\s*/gim"
    ,"subs"                   		: "RE::/[A-Za-z$][A-Za-z0-9$]*/"

I am having trouble with the 'somevar' part as I believe I can only identify it accurately as a subs type following after types var and eq.

My sequence is currently

"Syntax"                            : {
    "subs1"                  : {"sequence":["var", "eq", "subs"]}
    ,"js"                           : " comment | eq | operator | var | subs1 | subs | keyword  "
},

Am I being too hopeful, or is there a correct approach to the above requirement.

@foo123
Copy link
Owner

foo123 commented Oct 5, 2018

I'm not sure I understand what the problem is.
But in any case you can define the tokens like the following (simpler):

"var": "RE::/var\\b/i",
"eq": "=",
"sub": "RE::/[A-Za-z$][A-Za-z0-9$]*/"

Then either leave the "subs1" or "var" in the "js" sequence BUT NOT BOTH and make sure that "var" or "subs1" are BEFORE "subs" (and also put "keyword" BEFORE "subs" and AFTER "var" or "subs1").

If I miss something, please clarify and add a screenshot of the result if possible so I get an idea

@wangliabc
Copy link

里面的搜索功能可以做到不区分大小写吗?

@foo123
Copy link
Owner

foo123 commented Mar 9, 2022

@wangliabc , Please write in english, I am not a speaker of Chinese (although I would like to learn)
According to google translation you ask something about case sensitivity of search function. Please clarify your question and add some example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants